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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
justinrea
Regular Visitor

Percentage change from values in sliced table visuals

I'm very new to power bi and struggling with something that may be easy. I have a report page with multiple slicers that effect different tables.  I would like to calclulate the percentage difference between the performance values in these sliced tables .  How do I calculate the precentage difference between the performance value from the table on the left to the table on the right? the values are from the same data source table just sliced differently (slicers on the left change left table, slicers in the middle change right table). I would like a column on the table on the right with the percentage difference. For example the top line would be (22 - 21.93 / 22) = 3.18%. Any help is greatly appreciated.

filecompare.png

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

@justinrea

 

Nah, it is not easy.

 

Generally, we can use ALLSELECTED() function to get the values alter filtering. However since you are using the same source table for two table visuals and different slicers for each table visual. The slicer is a visual level filter, we cannot use it in another visual. And The measure cannot distinguish which slicer belongs to which table visual. So it is not possible to achieve your requirement if you are using one same data source.

 

But if you create a new table with same data in original table. You may get a workaround. Please refer:

 

In my sample, table2 and table3 are two same tables. I have created a measure with DAX expression like below to compare the two average. But we should put this measure in a new table visual.

Difference =
VAR temp =
    SELECTEDVALUE ( Table3[Item] )
VAR v1 =
    CALCULATE (
        AVERAGE ( Table2[Val] ),
        FILTER ( ALLSELECTED ( Table2 ), [Item] = temp )
    )
VAR v2 =
    CALCULATE (
        AVERAGE ( Table3[Val] ),
        FILTER ( ALLSELECTED ( Table3 ), [Item] = temp )
    )
RETURN
    v1 - v2

1.PNG

 

Thanks,
Xi Jin.

View solution in original post

1 REPLY 1
v-xjiin-msft
Solution Sage
Solution Sage

@justinrea

 

Nah, it is not easy.

 

Generally, we can use ALLSELECTED() function to get the values alter filtering. However since you are using the same source table for two table visuals and different slicers for each table visual. The slicer is a visual level filter, we cannot use it in another visual. And The measure cannot distinguish which slicer belongs to which table visual. So it is not possible to achieve your requirement if you are using one same data source.

 

But if you create a new table with same data in original table. You may get a workaround. Please refer:

 

In my sample, table2 and table3 are two same tables. I have created a measure with DAX expression like below to compare the two average. But we should put this measure in a new table visual.

Difference =
VAR temp =
    SELECTEDVALUE ( Table3[Item] )
VAR v1 =
    CALCULATE (
        AVERAGE ( Table2[Val] ),
        FILTER ( ALLSELECTED ( Table2 ), [Item] = temp )
    )
VAR v2 =
    CALCULATE (
        AVERAGE ( Table3[Val] ),
        FILTER ( ALLSELECTED ( Table3 ), [Item] = temp )
    )
RETURN
    v1 - v2

1.PNG

 

Thanks,
Xi Jin.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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