Forum Discussion
bilalkhokar73
5 years agoHelper IV
Dynamic Measure(Year Till date)
In clustered Graph I want to display a single measure which will show me sales of 2019 ,2020 & 2021. here I need sales till date this year , till date last year and till date last to last year so Th...
- 5 years ago
bilalkhokar73
Can you try it:MEASUREYEARTILL = VAR __lastsalesdate = CALCULATE(MAX(sales[datei] ),REMOVEFILTERS()) VAR day1 = DAY(__lastsalesdate) VAR MONTH1 = MONTH(__lastsalesdate) VAR __filterdate = DATE(MAX (tm_date[year_id]), MONTH1, day1 ) RETURN CALCULATE ( SUM(sales[amt]), tm_date[Date] <= __filterdate, REMOVEFILTERS ( tm_date), VALUES (tm_date[year_id] ) )
Fowmy
5 years agoSuper User
bilalkhokar73
Can you try it:
MEASUREYEARTILL =
VAR __lastsalesdate = CALCULATE(MAX(sales[datei] ),REMOVEFILTERS())
VAR day1 = DAY(__lastsalesdate)
VAR MONTH1 = MONTH(__lastsalesdate)
VAR __filterdate = DATE(MAX (tm_date[year_id]), MONTH1, day1 )
RETURN
CALCULATE (
SUM(sales[amt]),
tm_date[Date] <= __filterdate,
REMOVEFILTERS ( tm_date),
VALUES (tm_date[year_id] )
)
megane123
2 years agoFrequent Visitor
YOU ARE MY HERO. I have spent 7 hours today trying to get this to work with no success, this is exactly what I needed! Thank you lol š