Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all
I'm trying to do what I thought was a straightforward moving average calculation based the rate of crashed deals over the previous 3 months.
I've created a measure with the following DAX
Hi @stuieb
The second argument for DATESINPERIOD has to be a single value (start date). You are passing exactliy the same as the first argument, which seems to be a full column. You'll probably need to use SELECTEDVALUE( ), MAX( ) or something similar depending on what you want to do and where your measure is used
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Thank you for replying @AlB
This is probably my incorrect thinking. But what I am trying to pass to DATESINPERIOD is the current column value over the interated rows, that is to say, the current value of the date field in the row contex
If that's not possible, how could I calculate back to get an average for the previous 3 months?
Regards
Have you tried what I suggested?
CrashTrend = AVERAGEX(FILTER(Opportunity, DATESINPERIOD(Opportunity[Date_Off_Market__c], MAX(Opportunity[Date_Off_Market__c]), -3, MONTH)), [CrashRate])
If it doesn't work, you probably need to add an ALL to Opportunity in the first argument of FILTER. Otherwise I would need to see more details fo the data model to be able to come up with an accurate answer. Ideally a pbix that reproduces the problem
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @AlB
Yes, I have tried and unfortunately it doesn't work. The error is the same, wrapping the Opportunity in ALL() doesn't make a difference.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |