Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Dears:
I want to write a dax to calculate the average of 4 Quarters's value for previous Year,on the page , it has a slicer of Yearmonth, for example selecting 202307, I want to show 2022 year average in card. I got blank in the card with below codes. does anyone help me to solve this issue?
thanks
--Tonny
Codes is as below:
Solved! Go to Solution.
@tonny_bwg , if you do not have date, Create a date with help from month and year
example
date = date([Year], [Month no], 1)
Join it with date of date table and then try a measure like
Last YTD Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last year Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
YTD Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,previousyear('Date'[Date]))
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@tonny_bwg , if you do not have date, Create a date with help from month and year
example
date = date([Year], [Month no], 1)
Join it with date of date table and then try a measure like
Last YTD Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last year Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
YTD Sales = CALCULATE(Averagex(Values(Date[Qtr Year]), Calculate(SUM(Sales[Sales Amount]))) ,previousyear('Date'[Date]))
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |