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.
Howdy! I'd like to ask how to calculate a YTD average of a measure? E.g. below a line showing 80%, 72.5%, 68.3%, etc. On top of this, the underlying date strucutre is on a per day basis. I'd like the YTD average to be on sum of values in a month.
Any help would be much appreciated!
Example pbi: https://tmpfiles.org/download/102006/QuestionExample.pbix
Solved! Go to Solution.
Please try this measure expression. Note I first needed to add a Month column to your required table with
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this measure expression. Note I first needed to add a Month column to your required table with
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Awesome, that worked like a charm, thank you!!
Hi @Anonymous ,
According to your description, I created some data October 1, 2019 to December 5, 2020 to show
1. Open the line chart, place the date column in axis and the amount in value
2. Select analytics, find average line 1, and select Add. After that, a horizontal line will appear, which is the year to date average
3. Result.
You can downloaded PBIX file from here.
If my answer is not what you need, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yangliu-msft that is not quite what I'm looking for as I'd like the YTD average to change per month. I have attached an example pbi in my original question. Is there a recomendation as to the best way to share such files?
@Anonymous , Avg with TI and date table
example
YTD Sales = CALCULATE(Average(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))/ CALCULATE(distinctcount(Date[Month Year]),DATESYTD('Date'[Date],"12/31"), not(isblank(SUM(Sales[Sales Amount]))))
@amitchandak I don't think this works if the item is a measure. The "Average" function only works with columns.
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 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |