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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jboice
New Member

Help creating a measure to show cumulative values by week and category within a matrix visual

Hi folks, Hopng someone can help show me how to create a measure to populate a matrix visual as described below

 

Here is an example of my source data:

 

WeekCategoryValue
9/2/2023A1
9/2/2023C4
9/2/2023D5
9/9/2023A7
9/9/2023B3
9/9/2023D5
9/16/2023A4
9/16/2023B7
9/16/2023C8

 

 

From this data I am trying to create a matrix visual that resembles the following:

 

WeekCumulative Value
9/2/2023 10
A1
B0
C4
D5
9/9/202325
A8
B3
C4
D10
9/16/202344
A12
B10
C12
D10
Total44

 

 

Note each week includes the cumulative total up through that week, as well as the cumulative totals for each category (to show what is comprising the cumulative total at that week).

 

Each week shows all categories and their respective cumulative values through that week (or at least, each week should begin including them the first time they register a value, then continue including for subsequent weeks even in weeks when they do not register a new value)

 

Categories only appear in the data when they have registered a value for that week (otherwise they do not appear in the data for that week. For example in above data, Category "D" in week 9/16/2023)

 

Thank you for your help!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

create a proper data model

lbendlin_0-1701636624667.png

To report on things that are not there you need to use a crossjoin and a measure.

Cumul = 
var w = max(Weeks[Week])
return 0+CALCULATE(sum(Facts[Value]),Weeks[Week]<=w)

lbendlin_1-1701636689159.png

 

 

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

create a proper data model

lbendlin_0-1701636624667.png

To report on things that are not there you need to use a crossjoin and a measure.

Cumul = 
var w = max(Weeks[Week])
return 0+CALCULATE(sum(Facts[Value]),Weeks[Week]<=w)

lbendlin_1-1701636689159.png

 

 

 

Brilliant, thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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