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!
Need tips creating a measure "Average of last full three years". When user selects year 2021 measure should return average of years 2018-20.
One way is to create 3 different measures (parallel period -1, -2, -3 years) and make an avg-measure of those 3, but is it possible to combine these in one measure?
And I need to make this avg-measure from calculated measure like (F_Sales[amount],Dim1[code]=3])
Solved! Go to Solution.
Hi, @tuulia
Please correct me if I wrongly understood your question.
Please check the below measure and the link down below whether it is what you are looking for.
Average QTY of Last Full Three Years =
VAR currentyear =
MAX ( Dates[Year] )
RETURN
AVERAGEX (
FILTER (
ALL ( Dates[Year] ),
Dates[Year] >= currentyear - 4
&& Dates[Year] < currentyear
),
[Qty total]
)
https://www.dropbox.com/s/q3broy2yupyt8ay/tuulia.pbix?dl=0
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 @tuulia
Can you share whether these replies have solved your problem? If solved, kindly accept the appropriate one as solution. If not, can you describe your problem and expected result with some dummy data? The table structures and relationships will influence how a measure should be created to achieve your desired output. Without data, we can only imagine a table and create a measure based on that. Thanks.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
You can also use custom time intelligence for creating this measure..Refer the sceenshot below
Regards
sanalytics
Hi, @tuulia
Please correct me if I wrongly understood your question.
Please check the below measure and the link down below whether it is what you are looking for.
Average QTY of Last Full Three Years =
VAR currentyear =
MAX ( Dates[Year] )
RETURN
AVERAGEX (
FILTER (
ALL ( Dates[Year] ),
Dates[Year] >= currentyear - 4
&& Dates[Year] < currentyear
),
[Qty total]
)
https://www.dropbox.com/s/q3broy2yupyt8ay/tuulia.pbix?dl=0
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.
Thank you very much, this worked (with little changes)!
@tuulia , If you have date, then with help from date table
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-3,Year))/3
or
Rolling 3 = CALCULATE(AverageX(values('Date'[Year]),calculate(sum(Sales[Sales Amount])),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-3,Year))
Only year, with separate year table(say Date)
rolling = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]>=max('Date'[Year])-3 && 'Date'[Year]<=max('Date'[Year])) )/3
Or use average function
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |