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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

IF condition in calculate for running total

I am using this measure for calculating running total for current month:

RTUmsatz-CM =
VAR currentDay= DAY(TODAY())
RETURN
CALCULATE(
    Umsatz[Umsatz Gesamt]
,'Calendar'[MonthDayNumber]<=currentDay,
FILTER(ALLSELECTED('Calendar'[DateValue]), 'Calendar'[DateValue]<=MAX('Calendar'[DateValue]))
    )
What I want, is that the measure return blank for days we don't have a value. so basically, if today is 17.02, for 18.0 and days after the measure return nothing, instead of the last value of the running total.
 
so, I want something like this: 
 
RTUmsatz-CM =
VAR currentDay= DAY(TODAY())
RETURN
 
CALCULATE(
 IF(  'Calendar'[MonthDayNumber]<=currentDay, Umsatz[Umsatz Gesamt],BLANK())
, FILTER(ALLSELECTED('Calendar'[DateValue]), 'Calendar'[DateValue]<=MAX('Calendar'[DateValue]))
    )
 
 
But this return error. Can any one help?
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

Take a look at this article.  It shows ways to hide future dates when returning calculations.

https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/

 

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

@Anonymous 

Take a look at this article.  It shows ways to hide future dates when returning calculations.

https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.