Forum Discussion
hrafnkel11
4 years agoHelper I
Matrix Grouping Using What If Parameter
Hi – I have some calculations that previously took place in SQL that I have to move to Power BI using a What If parameter. Since we can’t use What If parameters within calculated columns, I’m at a lo...
amitchandak
4 years agoSuper User
hrafnkel11 , You need to create an independent table(Option) with two values Buying and non buying
measures
Buy 1= CALCULATE(
SUM(CUSTOMER[Amount]),
FILTER(ALL(
CUSTOMER[LastOrder_Days]),
CUSTOMER[LastOrder_Days]>='BUYING STATUS THRESHOLD'[BUYING STATUS THRESHOLD Value]
)
)
Status = if(isblank([measure]), "Buying", "Non Buying")
then a measure like
sumx(filter(values(CUSTOMER[Customer ID]), [Status] = max(Option[Option] )), CALCULATE(
SUM(CUSTOMER[Amount]) ))
- hrafnkel114 years agoHelper I
Thank you so much. Just in case anyone comes across this in the future, I needed to make one small adjustment in the Status measure (switching Buying and Not Buying), but this was the perfect solution. Thanks again!