The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello everyone,
I am a new Power BI user and need your help.
I have a data like on the table below. Field "Value" is a string type technically but intuitively its values are different types, it may be text, number, date or percent.
Parameter | Version | Value | Variable Type | |
par1 | 1 | 15 | Number | |
par2 | 1 | 5/15/2023 | Date | |
par3 | 1 | 0.15 | Percent | |
par4 | 1 | D1 | Text | |
par1 | 2 | 20 | Number | |
par2 | 2 | 6/15/2023 | Date | |
par3 | 2 | 0.16 | Percent | |
par4 | 2 | D2 | Text |
I have two slicer filters. One slicer - field "Version" where "1" will be selected and the second slicer again field "Version" where "2" will be selected. And I want to create table visual in Power BI where I should see the difference between the two versions of the field "Value". So the table like below
Filter 1 | Filter 2 | |||
Version -1 | Version-2 | |||
Frue/False | Dif | |||
par1 | FALSE | 5 | ||
par2 | FALSE | 1 | ||
par3 | FALSE | 0.10% | ||
par4 | FALSE | NA |
I tried to create those TRUE/FALSE and Difference measures but could not deal with it as the field "Value" has string type but intuitively its values can be date, numeric and etc.
Could you please help how can I solve this problem?
Thank you very much
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. 😊
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
63 | |
32 | |
21 | |
16 | |
15 |
User | Count |
---|---|
115 | |
33 | |
30 | |
24 | |
21 |