Forum Discussion
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=eyJrIjoiYTMzOWE3NjMtNzY4OC00MWNiLTliZTYtYTNjZjg1OGUzMmQ2IiwidCI6IjJkYzliZWU0LTJlMTQtNDA3Ni1hODZjLTQ0NjZhZDlkOWE0OCJ9. On page 4, I want to show the difference between 2017 and 2018 but can't for the life of me work out how. The data I'm using is from the comtrade database and the table uses the country, year, and value fields filtered by the commodity field.
4 Replies
- amitchandakSuper User
In 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 - mwegenerMost Valuable Professional
Hi seanmackaay ,
check this out. (Year-over-year change)
https://docs.microsoft.com/en-us/power-bi/desktop-quick-measures
https://docs.microsoft.com/en-us/dax/previousyear-function-dax
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support. - v-juanli-msftCommunity Support
Hi seanmackaay
Is this problem sloved?If it is sloved, could you kindly accept it as a solution to close this case?If not, please let me know.Best RegardsMaggie - amitchandakSuper User
seanmackaay , is the problem resolved