March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Power BI Community,
My requirement is to display
1. measure_new for Q2,
2. measure_old for any other quarters except 2022 - Q2
3. when select any quarter + Q2 - it should give the sum of selected quarters(measure_old) + 2022 Q2(measure_new) .
So, I have written this new measure:
test Q2 =
IF(SELECTEDVALUE ( 'date_slicer'[Date].[Year] )="2022",
IF(SELECTEDVALUE ( 'date_slicer'[Date].[Quarter])=="Q2",[measure_new],[measure_old]),
[measure_old])
This works as expected when selection is everything except Q2, which looks like below:
or selection is only Q2:
Challenge:
When the selection includes everything including Q2, my code will just return measure_old which is not expected.
Expected output is (329+67=396)
I am struggling to write correct dax to store result for just the Q2 values in var1, store result of everything selected except Q2 in var 2 and finally sum those var1 and var2.
Another same challenge, in all my dax I am using measure to calculate measure which will slow down the performance ultimately.
Any ideas??
Thank you in advance
@lukiz84 I tried to use VALUES function, but I was not able to store or use it.
This is something I am trying to achieve the task but failures again.
I don't really know what you are trying to achieve, but DATESBETWEEN is not what you think it is, ALLSELECTED neither.
SELECTEDVALUE only returns a value (not blank) when there is ONLY ONE (e.g. Q2) selected.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |