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.
Trying to create a dax based on the slicer selection of properties.
I had to create a measure to find the variance between two tables. I will call it Net Sales Var.
So then I have a Net Sales measure. If Property A is selected in the slicer, then I need Net Sales+Net Sales Var = Total Sales.
If Property B is selected, then I need Net Sales - Net Sales Var. How can I write that into the dax?
I tried using an IF dax =
IF('Prop Dim'[Property]="Property A", blah blah, but the IF doesn't except text columns. I'm thinking I need to use SELECTEDVALUE, but not sure how to write the dax. Any help is appreciated.
Solved! Go to Solution.
You need to wrap the text column in an aggregation, such as MAX(Table[Property]) or SELECTEDVALUE (Table[Property])
Both will return the same result.
Proud to be a Super User!
Paul on Linkedin.
You need to wrap the text column in an aggregation, such as MAX(Table[Property]) or SELECTEDVALUE (Table[Property])
Both will return the same result.
Proud to be a Super User!
Paul on Linkedin.
That did it. Thank you!
could you pls provide the sample data and expected output?
Proud to be a Super User!
I don't have an easy sample to provide. The current dax I'm trying to use says
IF('Table'[Property]="Property B", 'Table'[Sales]-Sales Var, 'Table'[Sales]+Sales Var
But because these columns are text, the IF function isn't recognizing them, so I'm not sure how to write the dax.
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 |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |