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,
I;m having trouble figuring out how to do 12 month moving averages.
My Model looks like this:
So users have onservations on specific dates and they can enter a nimber of scores for each observation.
Note that the relationship between Date and Observation Date cannot be mad active because it will break other measures in my report.
So I created these measures to show the count of scores, the total of the scores and the Average of the scores by month:
Now i am trying to keep it simple and just do a two month rolling average, so the Feb numbers should conolidate the Jan and Feb numbers, Mar should consolidate feb and Mar).
DId some googling on this and avideo was telling me to do something like this:
but that demo had an active relationship and min doesnt.
Anyone know how i can calulate the rolling 2 month average without an active relationship?
(link to pbx on github attached)
TIA
Russell
https://github.com/russgove/pbi/blob/main/RollingAverageUserRelationship.pbix
**bleep**, after writing all this out the answe dawned on me :
I don't see the point deactivating the relastionship between date table and Observations. Whatever, simple enough to author the measures,
R2M Count =
CALCULATE(
[ScoreCount],
DATESINPERIOD( Dates[Date], MAX( Dates[Date] ), -2, MONTH )
)
R2M Total =
CALCULATE(
[TotalScores],
DATESINPERIOD( Dates[Date], MAX( Dates[Date] ), -2, MONTH )
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |