Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi guys,
I need to show one index ([Öffnungsrate Measure]) for the current (or selected) month and either the previous month or, if there is no data previous month, for the month before that. If no data again, than three month ago etc. I wrote a measure for the last month ([ÖR last month]) and another measure with variables for -2 months, -3months etc. What I want this second measure to do is to show the value for the last month when there is data. When no data last month, then -2 months. if no data again, then -3 months etc. I wrote therefore multiple IFs in RETURN. However, it works only when the first IF is true ( so maximum two months back). If the first data comes only three months back, it doesn't show it. Can I use multiple IFs in RETURN at all? Is there an alternative? Any help would be greatly appreciated.
Cheers, Tanja
Measure 1:
Solved! Go to Solution.
Hi @Anonymous ,
You don't need to run IF() in each month. You could return the max month which is not blank and before current month.
Here is a solved case for your reference.
https://community.powerbi.com/t5/Desktop/Fill-blanks-with-previous-value/m-p/492501
Hi @Anonymous ,
You don't need to run IF() in each month. You could return the max month which is not blank and before current month.
Here is a solved case for your reference.
https://community.powerbi.com/t5/Desktop/Fill-blanks-with-previous-value/m-p/492501
Thank you for your reference, that's a very useful post! It corresponds to the suggestion of another Community Support team member:
ÖR previous period = VAR currDate = MAX ( DatumTabelle[Date] ) VAR prevDate = CALCULATE ( MAX ( DatumTabelle[Date] ); FILTER ( ALLSELECTED ( DatumTabelle ); [Date] < currDate && [Öffnungsrate Measure] <> BLANK () ) ) VAR prevAmount = CALCULATE ( [Öffnungsrate Measure]; FILTER ( ALLSELECTED ( DatumTabelle ); [Date] = prevDate ) ) RETURN IF ( prevAmount <> BLANK (); prevAmount; [ÖR last month] )
Thank you for your assistance!
Cheers, Tanja
Try Switch with true
https://docs.microsoft.com/en-us/dax/switch-function-dax
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
@amitchandak Thank you for your quick reply! I've tried what you suggested (see below) but it still doesn't work. it still shows the outcome only if the first condition is met (...ISBLANK(cdi_emailsendBase[ÖR last month]); zweimonate;).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |