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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.