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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.