Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

FUNCTION IF DOES NOT WORK

Hi,

I'm trying to use a function IF to change the name of the Cities to "Others" if they are not in my Top 15 based on highiest billing but my DAX isn't working.
I don't know if it is important but I also have a column "Year" that I use to filter in the visual.

I created this measure:

TopNCities = RANKX(ALL(BASE_RES_TABLEAU[CITY]),CALCULATE(SUM(BASE_RES_TABLEAU[Billing])))

And then I tried to create this column but is not working:
TopCity = IF([TopNCities] <= 15, BASE_RES_TABLEAU[CITY], "Others")

What I'm doing wrong?




 

3 REPLIES 3
eliasayyy
Memorable Member
Memorable Member

You need to use allexcept(table,year) if you are filtering by year

Anonymous
Not applicable

where do I use allexcept(table,year)?

In you rankx function instead of all

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.