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.
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.
Solved! Go to Solution.
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
Thanks,
Xi Jin.
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
Thanks,
Xi Jin.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |