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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Before and after today within a measure

Hello

I wish I could have an IF function within a measure that allows me to call another measure if it is before today and another if it is after today. Is it possible to do this and if so how?

The logic is essentially if( Calander[Date] < ? Today() , Cumulative Sum , Forecast )

Any help will be appreciated.

Best regards

Shaun

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Syndicate_Admin ,

if( max(Calander[Date]) < Today() , [Cumulative Sum] ,[Forecast] )

 

Or

 

calculate([Cumulative Sum], filter(Calander, Calander[Date] < Today() )) + calculate([Forecast] , filter(Calander, Calander[Date] >= Today() ))

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

1 REPLY 1
amitchandak
Super User
Super User

@Syndicate_Admin ,

if( max(Calander[Date]) < Today() , [Cumulative Sum] ,[Forecast] )

 

Or

 

calculate([Cumulative Sum], filter(Calander, Calander[Date] < Today() )) + calculate([Forecast] , filter(Calander, Calander[Date] >= Today() ))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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