Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
45 |