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.
Here's a DAX pattern that I have used in the past to forecast revenue. It worked great but now I'm trying to use the pattern on a different data set where there is not revenue for each day.
Here's the DAX
$ Revenue Forecast = IF( ISBLANK([$ Revenue]), CALCULATE([$ Revenue 30D MA], SAMEPERIODLASTYEAR('Date'[Date]) ), BLANK())
On the other data set the ISBLANK function would remove the Forecast for historical dates. But now since there are historical days without revenue the ISBLANK function is not working for the new data set.
Here's an example below:
As you can see there was no revenue last year on 1/5 or 1/6 so because [$ Revenue] is blank now it calcuates a forecaste amount.
Any ideas? Thanks!!!!
Solved! Go to Solution.
Here's one idea:
$ Revenue Forecast = VAR LastRevenueDate = LASTNONBLANK ( ALL ( 'Date'[Date] ), [$ Revenue] ) RETURN CALCULATE ( CALCULATE ( [$ Revenue 30D MA], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ), KEEPFILTERS ( DATESBETWEEN ( 'Date'[Date], LastRevenueDate + 1, BLANK () ) ) )
The logic is:
'Date' should be marked as date table for this to be a reliable measure (probably already is).
Does this work in your model?
Regards,
Owen
Here's one idea:
$ Revenue Forecast = VAR LastRevenueDate = LASTNONBLANK ( ALL ( 'Date'[Date] ), [$ Revenue] ) RETURN CALCULATE ( CALCULATE ( [$ Revenue 30D MA], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ), KEEPFILTERS ( DATESBETWEEN ( 'Date'[Date], LastRevenueDate + 1, BLANK () ) ) )
The logic is:
'Date' should be marked as date table for this to be a reliable measure (probably already is).
Does this work in your model?
Regards,
Owen
Works Perfectly, Thanks Owen!!!
User | Count |
---|---|
123 | |
76 | |
63 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |