Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I have used Matrix view to display profit and sales based on Fiscal year. I am not sure how to display the difference between 2023, 2022 sales and profit for each row.
Thanks in advance!
Solved! Go to Solution.
Hi @Naveen123 ,
If your table looks like as below, I suggest you to try to show difference in Column Subtotal part.
M_Sales =
VAR _THISYEAR = CALCULATE(SUM('Table'[Sales]),'Table'[Year] = 2023)
VAR _LASTYEAR = CALCULATE(SUM('Table'[Sales]),'Table'[Year] = 2022)
RETURN
IF(HASONEVALUE('Table'[Year]),CALCULATE(SUM('Table'[Sales])),_THISYEAR - _LASTYEAR)M_Profit =
VAR _THISYEAR = CALCULATE(SUM('Table'[Profit]),'Table'[Year] = 2023)
VAR _LASTYEAR = CALCULATE(SUM('Table'[Profit]),'Table'[Year] = 2022)
RETURN
IF(HASONEVALUE('Table'[Year]),CALCULATE(SUM('Table'[Profit])),_THISYEAR - _LASTYEAR)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Naveen123 ,
If your table looks like as below, I suggest you to try to show difference in Column Subtotal part.
M_Sales =
VAR _THISYEAR = CALCULATE(SUM('Table'[Sales]),'Table'[Year] = 2023)
VAR _LASTYEAR = CALCULATE(SUM('Table'[Sales]),'Table'[Year] = 2022)
RETURN
IF(HASONEVALUE('Table'[Year]),CALCULATE(SUM('Table'[Sales])),_THISYEAR - _LASTYEAR)M_Profit =
VAR _THISYEAR = CALCULATE(SUM('Table'[Profit]),'Table'[Year] = 2023)
VAR _LASTYEAR = CALCULATE(SUM('Table'[Profit]),'Table'[Year] = 2022)
RETURN
IF(HASONEVALUE('Table'[Year]),CALCULATE(SUM('Table'[Profit])),_THISYEAR - _LASTYEAR)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Naveen123 , You can use diff measure
example
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
or you can follow this approch
Power BI Time Intelligence- Show month names instead of Current Month Vs Last Month- https://youtu.be/x0DvPn1QeO4
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.