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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors