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, guys!
Thank you for attention and your time.
There question myabe simple, however still cant fid the answer.
Task: calculate measure SUM_YTD for last possible year, ingnoring part of time filter (slicer).
Example? Sure
Data:
Date | Object | Revenue |
01.01.2019 | 1 | 1000 |
01.02.2019 | 1 | 100 |
01.01.2020 | 1 | 2000 |
01.02.2020 | 1 | 200 |
01.01.2019 | 2 | 3000 |
01.02.2019 | 2 | 300 |
01.01.2020 | 2 | 4000 |
01.02.2020 | 2 | 400 |
Situation 1.
Filter (slicer): | 01.01.2019-31.12.2020 | |
Filter: | object 1 | |
Revenue | 2200 |
And its work perfect!
BUT
Situation 2.
Filter (slicer): | 01.01.2019-31.01.2020 | |
Filter: | object 1 | |
Revenue | 2000 |
😫
How to ignore filter's right side and calculate full year Revenue (2200) ?
I know, thats possible to cancel itiration between tables, but I want to save an apportunity to choose another year using this slicer to calculate measure.
Many thanks!
Solved! Go to Solution.
@Anonymous , Check YTD this year and Lat year complete. This is using Time Intelligence and calendar
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR('Date'[Date])),"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
@Anonymous , Check YTD this year and Lat year complete. This is using Time Intelligence and calendar
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR('Date'[Date])),"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
User | Count |
---|---|
120 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |