Forum Discussion
Finding Difference between Two Selections
Hello Nino1, welcome to the Power BI community! π
It seems like you are trying to create a table visual in Power BI that shows the difference between two versions of the field βValueβ based on two slicer filters. One solution to this problem could be to create a measure that calculates the difference between the two selected versions.
One way to do this is by duplicating the table with the same records (not having a relationship) and using the new table as the source of one slicer. Then, you can use a measure to compare the difference between the two selections1. Here is an example of a measure that calculates the difference between two selections:
Diff = CALCULATE ( SUM ( Table [Amount] ), ALLSELECTED ( Table [Column] ) ) - CALCULATE ( SUM ( NTable [Amount] ), ALLSELECTED ( NTable [Column] ) )
In this example, Table and NTable are two tables with the same records, and Column is the column used in the slicer. This measure calculates the sum of the Amount column for each selection and subtracts them to find the difference.
I hope this helps! Let me know if you have any further questions. π
- Nino13 years agoFrequent Visitor
Thank you for your response! I tried to write dax code as you suggested just it did not work as the data type is string and sum functon does not work with it.