March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
after some research without success, I decided to do my first post in this platform.
What I'm looking for, is to be able to know the variation of a measure from previous years considering that today is the beginning of the year 0 and, one year ago, was the beginning of ther year 1. Obviously, each day has to be dynamic and this will be chanching.
The aim of this, is to be able to know the variation of the pieces in a warehouse considering what has happened (which variation) during the last years.
So that, I am not interested what happened in 2021 or 2020, etc. What I am interested in is knowing which variation occured during the previous periods always considering the current date.
It is very simple with PARALELLPERIOD, SAMEPERIODLASTYEAR and DATEADD for natural years but, I got stucked trying to get this in this specific way.
I also created in the calendar a new column with YEARFRAC & round to have this variation in the calendar specified... but there was not way to emulate the result given in the typical case with the functions of time intelligence.
Thank you very much in advance!
Solved! Go to Solution.
Hi, @jmateu88 ;
Try it .
Measure =
CALCULATE (
[select_almacen],
FILTER ( ALL ( 'table' ), [YEAR_FRAC] = MAX ( 'table'[YEAR_FRAC] ) + 1 )
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @jmateu88 ;
Try it .
Measure =
CALCULATE (
[select_almacen],
FILTER ( ALL ( 'table' ), [YEAR_FRAC] = MAX ( 'table'[YEAR_FRAC] ) + 1 )
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
it works PERFECTLY!
You did it easy something it seemed complicated. Bravo!!
Thank you very much.
Thank you for your reply Amit but it is not what I am looking for.
To use one table would not be suitable because I need this for lots of cases.
In order to simplify it. I put an easy example:
What I want, is something which allows me to get the values with an arrow;
This is the typical which I am not interested.
Thank you anyway!
Better with a picture. In the upper case, is considering the natural years which is okay.
The second table, is where we can see that the method is incorrect.
@jmateu88 , with help from date table and time intelligence
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))
or
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Below can be done with year table too
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
refer TI based on today
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |