Forum Discussion
seanmackaay
6 years agoRegular Visitor
Difference between two columns in a matrix
Trying to work out the difference between two filtered columns in a matrix visual. The report is here: https://app.powerbi.com/view?r=eyJrIjoiYTMzOWE3NjMtNzY4OC00MWNiLTliZTYtYTNjZjg1OGUzMmQ2IiwidCI6I...
amitchandak
Super User
6 years agoIn case data is imported to power BI and you are using the calendar table. You can use datesytd and totalytd
examples
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"3/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"))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin