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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dydx
Frequent Visitor

Change month number used in a measure by a slicer

I have a measure that uses the number of months left in a year for exampe A/(12-current month)

Is it possible have a slicer that changes the current month from (10) for october to whatever month selected, (8) for August?

 

if it is how can i do i go about it?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@dydx , Not very clear you can have column like this in you date table

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

and you can display in meaure like

 

format(maxx(allselected('Date'), 'Date'[Date]), "MMM-YYYY")

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

View solution in original post

thank you for the prompt reply, i was able to get the value i wanted using

format(maxx(allselected('Date'), 'Date'[Date]), "M")

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@dydx , Not very clear you can have column like this in you date table

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

and you can display in meaure like

 

format(maxx(allselected('Date'), 'Date'[Date]), "MMM-YYYY")

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

thank you for the prompt reply, i was able to get the value i wanted using

format(maxx(allselected('Date'), 'Date'[Date]), "M")

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.