Forum Discussion
Using parameter/ filter values in DAX calculation
The Parameter drop down in the tutorial you've referenced needs to be created in Power Query. Power BI has two parameters:
* DAX parameters
* Power Query parameters
You could solve your problem using a simple filter for the users, as you've shown in one of your screenshots, but then must use a MEASURE to calculate the diff, because columns do not recalculate based on measure updates. See my Reporting Order of Operations blog post for more info on this: https://excelwithallison.blogspot.com/2020/09/reporting-order-of-operations.html
You can rewrite your column as a new MEASURE, just need to pick which aggregation to use, for example using SUM it would be:
diff = SUMX( my_tableName, my_price / competitor_price - 1 )
- nix_ferreira2 years agoRegular Visitor
Hi Allison, it works fine for calculations like that, but suppose I want to create a column (or measure) to classify the diff values as such:
IF(
diff < 0, "1",
IF(
diff < 0.1, "2",
"3"
)
)
Something like that. I'm afraid I can't do that with a measure, but I need to generalize that idea of creating dynamic columns with filter based values.