Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi!
I'm trying to combine to measures - Measure 1 & Measure 2 - based on what date it is. This is Measure 3. I want to show Measure 1's value for the days up until today, and Measure 2's value for today and forward. My current solution gives med the wrong total.
My DAX code right now:
Measure 3=
IF(
MAX([DATE]) < TODAY(),
[MEASURE 1],
[MEASURE 2]
)
As you can see I get the same total for Measure 3 as Measure 2. It should be 51, not 76.
FYI, I only have data in my columns to create Measure 1 and Measure 2 as they are in the picture.
Any ideas on what to do?
/Ella
Solved! Go to Solution.
Hi,
MyMeasure :=
VAR MyTable =
SUMMARIZE(
'Table',
'Table'[DATE],
"Value", IF( 'Table'[DATE] < TODAY(), [MEASURE 1], [MEASURE 2] )
)
RETURN
IF(
ISFILTERED( 'Table'[DATE] ),
IF( MAX( 'Table'[DATE] ) < TODAY(), [MEASURE 1], [MEASURE 2] ),
SUMX( MyTable, [Value] )
)
Regards
You're welcome!
Cheers
Hi,
MyMeasure :=
VAR MyTable =
SUMMARIZE(
'Table',
'Table'[DATE],
"Value", IF( 'Table'[DATE] < TODAY(), [MEASURE 1], [MEASURE 2] )
)
RETURN
IF(
ISFILTERED( 'Table'[DATE] ),
IF( MAX( 'Table'[DATE] ) < TODAY(), [MEASURE 1], [MEASURE 2] ),
SUMX( MyTable, [Value] )
)
Regards
Hi Jos! IT IS WORKING 🙂 Thank you so much for such a quick response!!
User | Count |
---|---|
17 | |
16 | |
14 | |
13 | |
12 |
User | Count |
---|---|
17 | |
14 | |
12 | |
10 | |
9 |