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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Bendelyon
Helper I
Helper I

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @johnbasha33 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1716865101678.png

 

Then you can create a field parameter.

vjialongymsft_1-1716865279909.png

Put the created field parameters into the slicer.

vjialongymsft_2-1716865458126.png

 

Create the following two measures to compare the difference between Budget, R2, and realized and put them into the card visual.

Budget_realized = IF(SELECTEDVALUE(Parameter[Parameter Order])=0,SUM('Table'[Budget]) - SUM('Table'[realized]),BLANK())
R2_realized = IF(SELECTEDVALUE(Parameter[Parameter Order])=1,SUM('Table'[R2]) - SUM('Table'[realized]),BLANK())

vjialongymsft_3-1716865603590.png

vjialongymsft_4-1716865612717.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @johnbasha33 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1716865101678.png

 

Then you can create a field parameter.

vjialongymsft_1-1716865279909.png

Put the created field parameters into the slicer.

vjialongymsft_2-1716865458126.png

 

Create the following two measures to compare the difference between Budget, R2, and realized and put them into the card visual.

Budget_realized = IF(SELECTEDVALUE(Parameter[Parameter Order])=0,SUM('Table'[Budget]) - SUM('Table'[realized]),BLANK())
R2_realized = IF(SELECTEDVALUE(Parameter[Parameter Order])=1,SUM('Table'[R2]) - SUM('Table'[realized]),BLANK())

vjialongymsft_3-1716865603590.png

vjialongymsft_4-1716865612717.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnbasha33
Super User
Super User

@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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.