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
PBI_V2
Helper IV
Helper IV

Power BI - Overall calculation for a matrix

Hello All,

 

We have a matrix visual which shows region wise sales information. Now we need to add a Overall column which should be sum of the regions with some conditions. Below is the detail:

 

PBI_V2_0-1716304286104.png

 

How to achieve it.

 

Thanks,

PBI V2

1 ACCEPTED SOLUTION

@PBI_V2 Maybe something like this although I am still not clear on when something goes "green" in your matrix:

Measure 2 = 
    VAR __Latest = MAX('Table'[Custom])
    VAR __Table = FILTER( ALL('Table'), [Custom] <= __Latest && [Status_Color] = "Green" )
    VAR __Regions = DISTINCT( SELECTCOLUMNS( __Table, "__Region", [Region] ) )
    VAR __Result = SUMX( FILTER( 'Table', [Region] IN __Regions ), [Sales Amount] )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@PBI_V2 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hello @Greg_Deckler ,

 

Thanks for your response.

Below is the sample data that we are using for Reporting:

MonthRegionSales AmountStatus_Color
Dec'23America277833Blue
Dec'23America277833Blue
Dec'23America277833Blue
Jan'24America216333Green
Jan'24America216333Green
Jan'24America216333Blue
Nov'23America277833Green
Nov'23America277833Blue
Nov'23America277833Green
Nov'23America277833Blue
Nov'23America277833Orange
Oct'23America277833Blue
Oct'23America277833Green
Oct'23America277833Blue
Oct'23America277833Blue
Oct'23America277833Orange
Dec'23Asia Pacific100572Blue
Dec'23Asia Pacific100572Blue
Dec'23Asia Pacific100572Blue
Jan'24Asia Pacific91700Green
Jan'24Asia Pacific91700Green
Jan'24Asia Pacific91700Blue
Nov'23Asia Pacific100572Green
Nov'23Asia Pacific100572Blue
Nov'23Asia Pacific100572Green
Nov'23Asia Pacific100572Blue
Nov'23Asia Pacific100572Orange
Oct'23Asia Pacific100572Blue
Oct'23Asia Pacific100572Green
Oct'23Asia Pacific100572Blue
Oct'23Asia Pacific100572Blue
Oct'23Asia Pacific100572Orange
Dec'23EMEA123564Blue
Dec'23EMEA123564Blue
Dec'23EMEA123564Blue
Jan'24EMEA116380Green
Jan'24EMEA116380Green
Jan'24EMEA116380Blue
Nov'23EMEA123564Green
Nov'23EMEA123564Blue
Nov'23EMEA123564Green
Nov'23EMEA123564Blue
Nov'23EMEA123564Orange
Oct'23EMEA123564Blue
Oct'23EMEA123564Green
Oct'23EMEA123564Blue
Oct'23EMEA123564Blue
Oct'23EMEA123564Orange
Dec'23Europe212378Blue
Dec'23Europe212378Blue
Dec'23Europe212378Blue
Jan'24Europe197720Green
Jan'24Europe197720Green
Jan'24Europe197720Blue
Nov'23Europe212378Green
Nov'23Europe212378Blue
Nov'23Europe212378Green
Nov'23Europe212378Blue
Nov'23Europe212378Orange
Oct'23Europe212378Blue
Oct'23Europe212378Green
Oct'23Europe212378Blue
Oct'23Europe212378Blue
Oct'23Europe212378Orange
Dec'23Oceania185450Blue
Dec'23Oceania185450Blue
Dec'23Oceania185450Blue
Jan'24Oceania162734Green
Jan'24Oceania162734Green
Jan'24Oceania162734Blue
Nov'23Oceania185450Green
Nov'23Oceania185450Blue
Nov'23Oceania185450Green
Nov'23Oceania185450Blue
Nov'23Oceania185450Orange
Oct'23Oceania185450Blue
Oct'23Oceania185450Green
Oct'23Oceania185450Blue
Oct'23Oceania185450Blue
Oct'23Oceania185450Orange


Thanks,

PBI V2

@PBI_V2 Maybe something like this although I am still not clear on when something goes "green" in your matrix:

Measure 2 = 
    VAR __Latest = MAX('Table'[Custom])
    VAR __Table = FILTER( ALL('Table'), [Custom] <= __Latest && [Status_Color] = "Green" )
    VAR __Regions = DISTINCT( SELECTCOLUMNS( __Table, "__Region", [Region] ) )
    VAR __Result = SUMX( FILTER( 'Table', [Region] IN __Regions ), [Sales Amount] )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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.