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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ShaelynFrench
Helper I
Helper I

Can a visual be filtered to show 5 full years plus complete months in current year?

Hi,

 

I want the graph to show 5 full years and then January - March for 2023. The incomplete April data is throwing the entire thing off. How can this be acheived?

 

ShaelynFrench_0-1680825438074.png

 

1 ACCEPTED SOLUTION

@ShaelynFrench , Sorry, my bad. Try like

 

Measure =

var _today = maxx(allselected(Table), Table[Date])

var _max = if(eomonth(_today, 0) = _max , eomonth(_today, 0) ,eomonth(_today, -1) )

return

if(max(date[Date]) > _max, blank(), [M1])

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

4 REPLIES 4
amitchandak
Super User
Super User

@ShaelynFrench , Assuming you are using Measure M1, then try a new measure like

 

Measure =

var _max = maxx(allselected(Table), Table[Date])

var _max = if(eomonth(today(), 0) = _max , eomonth(today(), 0) ,eomonth(today(), -1) )

return

if(max(date[Date]) > _max, blank(), [M1])

 

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

Hi,

 

@amitchandak This returns error "Variable '_max' cannot be created because a table or variable with the same name already exists." I assume since there are two var _max

@ShaelynFrench , Sorry, my bad. Try like

 

Measure =

var _today = maxx(allselected(Table), Table[Date])

var _max = if(eomonth(_today, 0) = _max , eomonth(_today, 0) ,eomonth(_today, -1) )

return

if(max(date[Date]) > _max, blank(), [M1])

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

That works! Thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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