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,
In my historical project table I have created the following measure:
Solved! Go to Solution.
Hi,
Thank you for your message, and please check the below picture and the attached pbix file whether it suits your requirement.
Expected avg measure: =
VAR _maxdatebyIDtable =
CALCULATETABLE (
Data,
TREATAS (
GROUPBY (
Data,
Data[ID],
"@maxdate", MAXX ( CURRENTGROUP (), Data[Name ModifiedOn] )
),
Data[ID],
Data[Name ModifiedOn]
)
)
RETURN
DIVIDE (
SUMX ( _maxdatebyIDtable, Data[Days since modification] ),
COUNTROWS ( _maxdatebyIDtable )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure how your dataset looks like, but please try something like below and check whether it works for your dataset.
expected measure: =
AVERAGEX (
ADDCOLUMNS (
VALUES ( 'projecttable'[projectID] ),
"@datediff", [TimeSinceModification]
),
[@datediff]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan,
I have tried to replicate the structure of my data tabel and hope it gives better meaning now:
E.g. you can see that I have filtered 6 unique project. But project 260 have 2 different modification date and it should only calculate the Lates modified.
So here the correct Average should be (roundet) 5
Hi,
Thank you for your message, and please check the below picture and the attached pbix file whether it suits your requirement.
Expected avg measure: =
VAR _maxdatebyIDtable =
CALCULATETABLE (
Data,
TREATAS (
GROUPBY (
Data,
Data[ID],
"@maxdate", MAXX ( CURRENTGROUP (), Data[Name ModifiedOn] )
),
Data[ID],
Data[Name ModifiedOn]
)
)
RETURN
DIVIDE (
SUMX ( _maxdatebyIDtable, Data[Days since modification] ),
COUNTROWS ( _maxdatebyIDtable )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I have implemented your solution and it works perfectly.
Thanks
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 |
---|---|
46 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
74 | |
51 | |
45 | |
16 | |
12 |