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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
10168
Helper I
Helper I

Calculated column that excludes topN value from a column within the same table

Dax Experts, I have a data model with calender (picture attached), I have the report with 'Fiscal Month Key' on X-axis, however I'm trying to use a new calculated column as X-axis on my report but I need to exclude TOPN value from the column, here (202208- FiscalMonthKey), I tried MAXX function, however I havent been successful, any help or direction is really appreciated. 

 

Eventually I'm trying to switch between these two axises (one that includes MAX month and one without). 

 

Thanks so much in advance 

 

10168_0-1668531401902.png

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @10168 ,

You can create a measure like:

Measure = 
var _max = CALCULATE(MAX('Calendar'[Fiscal Month Key]),ALL('Calendar'))
var _result = IF(MAX('Calendar'[Fiscal Month Key])=_max,1)
return
_result

 If you need to keep the external filter, you can replace ALL with ALLSELECTED.

 

Then set the visual level filter and bookmark:

vcgaomsft_0-1668565626146.png

vcgaomsft_2-1668565701783.png

With the bookmark button, you can freely switch back and forth.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @10168 ,

You can create a measure like:

Measure = 
var _max = CALCULATE(MAX('Calendar'[Fiscal Month Key]),ALL('Calendar'))
var _result = IF(MAX('Calendar'[Fiscal Month Key])=_max,1)
return
_result

 If you need to keep the external filter, you can replace ALL with ALLSELECTED.

 

Then set the visual level filter and bookmark:

vcgaomsft_0-1668565626146.png

vcgaomsft_2-1668565701783.png

With the bookmark button, you can freely switch back and forth.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

amitchandak
Super User
Super User

@10168 , A new flag that can help

if([Fiscal Month key] =max([Fiscal Month key]), "Exclude", "Include")

 

 

or a meausre 

 

var _max = maxx(allselected(Date), date[Fiscal Month key])

return

calculate(sum(Table[value), filter(date, date[Fiscal Month key] <_max))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.