Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi
I have this DAX
SUM(M_KPI[Points]) = dynamic number and keep changing
"discount" and "cashback" = categories
"South City" and "North City" = zone
KPI_Points =
IF((SUM(SALES[Points] ) > SUM(M_KPI[Points]) && VALUES (SALES [TYPE]) = "discount" && VALUES (Sales [Zone] )= "South City","Red","Black"),
IF(SUM(SALES[Points] ) > SUM(M_KPI[Points]) && VALUES (SALES [TYPE]) = "cashback" && VALUES (Sales [Zone] )= "North City","Red","Black"))
but the result gave me an error
is there anything wrong?
Solved! Go to Solution.
Hi @Anonymous
You cold try the following measure:
KPI_Points =
IF (
SUM ( SALES[Points] ) > SUM ( M_KPI[Points] )
&& (
(
VALUES ( SALES[TYPE] ) = "discount"
&& VALUES ( Sales[Zone] ) = "South City"
)
|| (
VALUES ( SALES[TYPE] ) = "cashback"
&& VALUES ( Sales[Zone] )
) = "North City"
),
"Red",
"Black"
)
If it still could not work,could pls provide your pbix file ? Remember to remove the confidential information.
Best Regard
Lucien Wang
Hi @Anonymous
You cold try the following measure:
KPI_Points =
IF (
SUM ( SALES[Points] ) > SUM ( M_KPI[Points] )
&& (
(
VALUES ( SALES[TYPE] ) = "discount"
&& VALUES ( Sales[Zone] ) = "South City"
)
|| (
VALUES ( SALES[TYPE] ) = "cashback"
&& VALUES ( Sales[Zone] )
) = "North City"
),
"Red",
"Black"
)
If it still could not work,could pls provide your pbix file ? Remember to remove the confidential information.
Best Regard
Lucien Wang
Thank I tried this and it's work, many thank 😄
I have question-related IF with AVERAGE, I used this DAX logic but it doesn't work
May you take look it my DAX is wrong ?
https://community.powerbi.com/t5/Desktop/Different-average-based-on-filter/m-p/1680012#M669449
Hi @Anonymous ,
I click your link and find your cace about Different average based on filter has been taken over by other engineer,he will follow your questions.thanks!
Best regard
Lucien Wang
@v-luwang-msftcould you help me because I think your solution more closely match with I am looking for
@Anonymous , Try a measure like
KPI_Points =
Switch( true() ,
SUM(SALES[Points] ) > SUM(M_KPI[Points]) && max (SALES [TYPE]) = "discount" && Max (Sales [Zone] )= "South City","Red",
SUM(SALES[Points] ) > SUM(M_KPI[Points]) && max (SALES [TYPE]) = "cashback" && Max (Sales [Zone] )= "North City","Red"
,"Black")
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.