Forum Discussion
AVERAGEX Problems
Hello all,
I am pulling my hair out with an AVERAGEX formula
Anonymous
Try this
Water TRIFR 12MMA = VAR monthrange = 12 VAR result = DIVIDE ( SUMX ( DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Calendar'[Date] ), -1 * monthrange, MONTH ), [Water TRIFR] ), monthrange, BLANK () ) RETURN result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
17 Replies
- AllisonKennedyCommunity Champion
I'm not 100% sure how the graph on the bottom right relates to the AVERAGEX measure in question?
What is the DAX formula for [Water TRIFR] and what does that Measure look like when plotted against the same time period in the same report and page as the graph on the bottom left?
- AnonymousNot applicable
Hey,
So the graph on the bottom right is a DAX formula that looks through a data set and counts the number of entries that have the correct value. Here is the DAX for that
CAMMS Total Injury = CALCULATE(COUNT('CAMMS Incidents'[Report Type]),'CAMMS Incidents'[Report Type] IN {"Injury"})So I use that to test to see a simple count each month, I then went back to the data and did a manual physical count to see if it matched (which it does)I then take that amount and put it into an industry specific formula that shows a "frequency rate"Water TRIFR = ([CAMMS Total Injury]*1000000) / ([Water Hours / Month])This forumla shows me for every million hours worked how many injuries do we have.I then plot that into my 12MMA formula from before.
- nandukrishnavsCommunity Champion
Anonymous
Create another DAX measure and add that in the tooltip.
LastDateValue=LASTDATE ( 'Calendar'[Date] )Then verify its value in both visuals. Maybe it is creating issue.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- AnonymousNot applicable
- nandukrishnavsCommunity Champion
Anonymous
Try this
Water TRIFR 12MMA =
AVERAGEX (
DATESINPERIOD (
'Calendar'[Date].[Date],
LASTDATE ( 'Calendar'[Date].[Date] ),
-12,
MONTH
),
[Water TRIFR]
)
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂Here is my latest blog
https://community.powerbi.com/t5/Community-Blog/Dynamic-Page-Navigation-Based-on-User-Login/ba-p/1097786