Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have a table with a colum with 3 différents values. Budget, R2 and realized ans another with sales numbers.
I need to compare the sales numbers values in termes of the three values R2, budget ans realized. I do not want to import my table twice.
The final objective IS to have a power Bi page with two card about sales numbers and two segment with the choice between the three values R2, budget and realized.
Thanks for your help
You can achieve this in Power BI using a single table and measures. Here's a general approach:
1. Create a table visualization with the sales numbers column.
2. Create a slicer visualization with the three different values (R2, Budget, Realized).
3. Create three measures to calculate the sales numbers based on the selected value in the slicer.
Here's an example of how you can create the measures:
```DAX
Sales R2 =
IF (
SELECTEDVALUE ( 'YourTable'[YourColumn] ) = "R2",
SUM ( 'YourTable'[Sales] ),
BLANK ()
)
Sales Budget =
IF (
SELECTEDVALUE ( 'YourTable'[YourColumn] ) = "Budget",
SUM ( 'YourTable'[Sales] ),
BLANK ()
)
Sales Realized =
IF (
SELECTEDVALUE ( 'YourTable'[YourColumn] ) = "Realized",
SUM ( 'YourTable'[Sales] ),
BLANK ()
)
```
Replace `'YourTable'` with the name of your table and `'YourColumn'` with the name of the column containing the three different values.
Once you have created these measures, add them to the card visualizations on your Power BI page. When you select a value in the slicer, the corresponding card will show the sales numbers based on the selected value.
Additionally, you can use conditional formatting on the card visuals to highlight the values based on your requirements.
This approach allows you to compare the sales numbers dynamically based on the selected value (R2, Budget, Realized) without duplicating the table.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Hello @johnbasha33
This IS where i am thank you to confirm myself in this solution to calculate the values.
Maybe i did not use the correct words i am sorry, when a talk about compare i need to calculate the difference between two values selected.
How Can i do this ?
The solution for now IS to load the table containing the values R2, budget, realized twice to make two slicers one for each tables
Thanks for your help.