Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Matrix with measure based on row sums

Hi

I have two sets of values (X and Y) that vary by Month and Year.

I am trying to build a matrix of Columns=Month and Rows=Year, where the values use a measure:

X / (sum of Y for entire year)

Eg for 08 2020, the value would be (X for 08 2020) / (sum of Y for 2020)

 

Currently I can only manage setting a measure of (X for 08 2020) / (Y for 08 2020).

Would anyone be able to help with this please? Sorry I am new to Power BI but any tips would be appreciated!

Thanks

 

1 ACCEPTED SOLUTION

@Anonymous , You can try measure like, But prefer a separate year month table

 

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('YearMo'),'YearMo'[Year]=max('YearMo'[Year])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Use date table, when you select month year or that is on the rows, these options can give you a complete year

This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))

 

Year Sales = CALCULATE(SUM(Sales[Sales Amount]),previousyear(dateadd('Date'[Date],1, year)))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
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 :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks for your reply.

I don't have dates in my data, only a month and a year. So at each row/col label month/year in the table I need to have (data value X for that month/year)/(sum of data for that year). So can't sum data up to a date

(Apologies if I have misunderstood the explanation)

@Anonymous , You can try measure like, But prefer a separate year month table

 

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('YearMo'),'YearMo'[Year]=max('YearMo'[Year])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thank you very much!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.