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
Hello everyone, I'm having a problem with time comparisons using the following formulas (indicated by a forum user):
YTDmeasure= TOTALYTD(SUM(Table[Total Sales]), Table[Dates])
PYTDmeasure= CALCULATE(YTDmeasure, PARALLELPERIOD(Table[Dates], -12, Months))
Comparison= DIVIDE(YTDmeasure-PYTDmeasure, PYTDmeasure)
(Obviously I insert the values of my table and I also added a comparison between this year and two years ago)
In general they work very well, but in some cases (like the one below) they report incorrect values:
CY = Current Year; PY = Previous Year; 2PY = comparison with two years ago; YTD = Year to Date
The following values, for example, are correct (I report them in order to have a further feedback):
N.b: all comparisons work up to today's date.
Thanks a lot to those who want to try to solve the problem and have a good day.
Gabriele
@ElektroCED , Try like
Use date table
YTDmeasure= TOTALYTD(SUM(Table[Total Sales]), 'Date'[Dates])
PYTDmeasure= TOTALYTD(SUM(Table[Total Sales]),dateadd( 'Date'[Dates],-1, year))
refer if needed
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
I used the function that you suggested to me but when i try to filter for a state it goes in error.
Below the real functions I use:
IMPORTO_PAG_V1 YTDmeasure = TOTALYTD(SUM(view_PBI_ORD_CLI[IMPORTO_PAG_V1]), view_PBI_ORD_CLI[DATA_DOC])
@ElektroCED , Please use date table, Which is very important for time intelligence
YTDmeasure= TOTALYTD(SUM(view_PBI_ORD_CLI[IMPORTO_PAG_V1]), 'Date'[Dates])
PYTDmeasure= TOTALYTD(SUM(view_PBI_ORD_CLI[IMPORTO_PAG_V1]),dateadd( 'Date'[Dates],-1, year))
refer
Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
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 |
|---|---|
| 45 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |