Forum Discussion
bestevezdyb
2 years agoFrequent Visitor
DAX SelectedValue With If
Good morning, I would like to understand how to solve a problem that apparently is getting complicated. I have created a metric that is NumberOfPizza = VAR _qty = COUNTROWS( order_details ) R...
- 2 years ago
I think I have the solution
SelectedValue =VAR _qty = [NumberOfPizza]RETURNIF(_qty = 0,CALCULATE(MAX(order_details[pizza_id]), REMOVEFILTERS(DimDate)), -- Devuelve el valor de pizza_id si _qty es 0SELECTEDVALUE( order_details[pizza_id] ))
bestevezdyb
2 years agoFrequent Visitor
- bestevezdyb2 years agoFrequent Visitor
I think I have the solution
SelectedValue =VAR _qty = [NumberOfPizza]RETURNIF(_qty = 0,CALCULATE(MAX(order_details[pizza_id]), REMOVEFILTERS(DimDate)), -- Devuelve el valor de pizza_id si _qty es 0SELECTEDVALUE( order_details[pizza_id] ))