Power Bi Dax - Measure that calculates one measure for a period and another if not in that timeframe

Viewed 21

I am essentially trying to say from 1/1/2022 through 3/31/2022 use a certain measure and if not in that timeframe then use another measure. The purpose is for these months a different calculation was used to determine the total and for the remainder of the time it was the unchanged, so I want to see the total trended out over time that will not be filtered and for those 3 months show the 'Diff_Total'. I've tried a few things other than this and in this particular attempt it won't let me select a column from the 'Date_Table'...

= CALCULATE(IF(Date_Table > DATE(2022, 01, 01) && Date_Table < DATE(2022, 03, 31), [Diff_Total], [Original_Total]))
1 Answers

I've got it working with

Measure = 
VAR Dateinrange = 
    AND(
        min(Date_Table[Date]) > DATE(2022, 01, 01), 
        min(Date_Table[Date]) < DATE(2022, 03, 01)
    )
RETURN IF(Dateinrange=TRUE(),[Diff_Total], [Original_Total])

Let me know if that works for you!

Related