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
SBC
Helper III
Helper III

How to do summation only for few rows in matrix visual

How to summation only which starts with NG_ and that summation should be shown in NG_GYM

 

Iam using matrix visual in power bi  exposure column was created by using dax measure

 

Expos = CALCULATE(SUM('TA Expos'[expo]),USERELATIONSHIP('Calendar'[Date],'TA Expos'[Trading_Period_date]))

 

 

Note:

Remaining all other curve should show the values as it is without doing any summation

 

Currenlty matrix visual data looks like below:

 Curve 

Expos

 TL

HD

NG_AE

5

5

5

NG_HSC

-10

5

5

NG_DTI 

-20

4

24.73

NG_GYM

-20

1

0

LNG_JK

5

1

5

AD OFF 216

5

3

5

BR_Nor

-250.72  

2

5

 

Expected output:

Curve 

Expos

 TL

HD

NG_AE

5

5

5

NG_HSC   

-10

5

5

NG_DTI 

-20

4

24.73

NG_GYM

-45

1

0

LNG_JK

5

1

5

AD OFF 216

5

3

5

BR_Nor

-250.72  

2

5

SBC_0-1677133322505.png

Thanks,

SBC

2 REPLIES 2
MAwwad
Solution Sage
Solution Sage

 

To sum only the rows that start with "NG_" and show the result in the "NG_GYM" row, you can create a new measure in Power BI using the following DAX expression:

 

 
NG_GYM Expos = VAR SelectedRows = FILTER('TA Expos', LEFT('TA Expos'[Curve], 3) = "NG_") RETURN SUMX(SelectedRows, 'TA Expos'[Expos])
 

This measure creates a variable "SelectedRows" that filters only the rows where the "Curve" column starts with "NG_". It then uses the SUMX function to sum the "Expos" column for the selected rows.

To show the result in the "NG_GYM" row, you can add this measure to the "Values" section of the matrix visual and drag the "Curve" column to the "Rows" section. The other rows will show the original values from the "Expos" measure.

Hi @MAwwad 

thanks for the reply but it showing wrong data showing blank values for the other than NG_ and for NG- related showing different  data

SBC_0-1677148030315.png

could you please check at you end once,are we getting the expected output? as i  mentioned

SBC_1-1677148163953.png

 

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.