Forum Discussion
AmandaLu
4 years agoFrequent Visitor
Calculate the difference between two columns in a matrix when each row is a measure
Hi, I'm working on a matrix in Power BI that compares this fiscal years' sales, transactions, units, customerscount to last year's. Each row is it's own calculated measure. Is there any ...
- 4 years ago
Hi AmandaLu
Yes that can be done utilizing the column subtotal. For exampleMeasure2 = VAR CurrentValue = [Measure1] VAR MaxYear = MAX ( 'Date'[Year] ) VAR MinYear = MIN ( 'Date'[Year] ) VAR MaxYearValue = CALCULATE ( [Measure1], 'Date'[Year] = MaxYear ) VAR MinYearValue = CALCULATE ( [Measure1], 'Date'[Year] = MinYear ) RETURN IF ( HASONEVALUE ( 'Date'[Year] ), CurrentValue, MaxYearValue - MinYearValue )And you can manually change the name from "Total" to "Difference"
AmandaLu
4 years agoFrequent Visitor
That would be great! Are you able to join the meeting at 1 pm today? or just let me know what time is convenient for you.
Join Zoom Meeting
https://zoom.us/j/96020170183?pwd=YzBFWVhhdXRhcHdHT0Z2aHc1clRTdz09
Meeting ID: 960 2017 0183
Passcode: yLZ8fd