This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Good Morning All,
I am struggling with this formula it works for when the number of rows is 2 and the cumulated segmentation however when i put in the the extra count of 3 rows it doesn't classify them "A","B" and "C", instead it comes up with an error. Any help would be greatly appreciated.
Many Thanks
ABC Product =
VAR NoOfRows =
COUNTROWS (
CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) )
)
RETURN
SWITCH (
TRUE (),
NoOfRows = 2, IF (
RANKX (
CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ),
ABC[Sales Revenue]
)
= 1,
"A",
"B"
),
NoOfRows = 3, IF (
RANKX (
CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ),
ABC[Sales Revenue]
)
= 1,
"A",
"B",
“C”
),
ABC[Cumulated Percentage] <= 0.8, "A",
ABC[Cumulated Percentage] <= 0.95, "B",
"C"
)
Solved! Go to Solution.
@Mack1int,
Please change your DAX formula to the following:
ABC Product = VAR NoOfRows = COUNTROWS ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ) ) RETURN SWITCH ( TRUE (), NoOfRows = 2, IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 1, "A", "B" ), NoOfRows = 3, IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 1, "A", IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 2,"B", "C" )), ABC[Cum Percent] <= 0.8, "A", ABC[Cum Percent] <= 0.95, "B", "C" )
Regards,
Lydia
@Mack1int,
Please change your DAX formula to the following:
ABC Product = VAR NoOfRows = COUNTROWS ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ) ) RETURN SWITCH ( TRUE (), NoOfRows = 2, IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 1, "A", "B" ), NoOfRows = 3, IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 1, "A", IF ( RANKX ( CALCULATETABLE ( ABC, ALLEXCEPT ( ABC, ABC[Location], ABC[Brand] ) ), ABC[Sales Revenue] ) = 2,"B", "C" )), ABC[Cum Percent] <= 0.8, "A", ABC[Cum Percent] <= 0.95, "B", "C" )
Regards,
Lydia
Thank you so much @Anonymous
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 21 |