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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.