Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Bendelyon
Frequent Visitor

How to compare between severals values in a simple table

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

2 REPLIES 2
johnbasha33
Solution Sage
Solution Sage

@Bendelyon 

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.

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors