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
Pbiuserr
Post Prodigy
Post Prodigy

calendar table - flag last full month

Hello,

I've created calculated column 

 

LFM = Switch( True(),
eomonth('Calendar'[Date],0)= eomonth(Today(),-1),"Last Full Month",
Format('Calendar'[Date],"MMM YYYY")
)

It works nearly perfect, but for example today I have Last Full Month from 30 April to 30 May. It supposed to be 1st of May till 31st of May as Last Full Month. Tommorow (1.07.2022) it supposed to be 1.06.2022 - 30.06.2022

Can someone help me with that?

edit: can someone remove this thread? I've had a visual bug, everything is fine


1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Pbiuserr , The above code is correct. I really doubt it can give that output .

 

Just create the column again and check

 

I use similar stuff

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

 

 


Can you share  a sample pbix after removing sensitive data.

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Pbiuserr , The above code is correct. I really doubt it can give that output .

 

Just create the column again and check

 

I use similar stuff

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

 

 


Can you share  a sample pbix after removing sensitive data.

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.