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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Sum a row using visible columns

I have created a table that allows a user to choose what data columns they wish to see (via field parameters).  There are up to 4 possible values they can select from.  I need to get a dynamic total across each row based on those selected columns.  

 

So, for example, if they choose all 4 severity levels, the first row would total 10, second row would be 3, etc.  But if they chose only Sev2 and Sev4 (meaning only those 2 data columns would be visible), they would get 4 in the first, 2 in the second etc.  There are other values that can be calculated as well (such as year over year percent of change and so on) but those would obviously be calculations similiar to this basic one.

 

Ruthie09_0-1739206591261.png

 

What formula would acheive that result?

1 ACCEPTED SOLUTION

SEV1 has no data

 

lbendlin_0-1739229614099.png

 

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Anonymous
Not applicable

If the user selected all 4 severity levels, the goal is for the Total Count column to equal this:

Business UnitSEV1 CYTDSEV2 CYTDSEV3 CYTDSEV4 CYTDTotal Count
Unit 1  6410
Unit 2  123
Unit 3 291021
Unit 4  224
Unit 5 19515
Unit 6  1 1
Unit 7 419326
Unit 8  3 3

 

If the user only selected columns 2 & 4, for example, the result would be this:

Business UnitSEV2 CYTDSEV4 CYTDTotal Count
Unit 1 44
Unit 2 22
Unit 321012
Unit 4 22
Unit 5156
Unit 6  0
Unit 7437
Unit 8  0

 

If they selected 1 & 2, it would be this:

Business UnitSEV1 CYTDSEV2 CYTDTotal Count
Unit 3 22
Unit 5 11
Unit 7 44

 

My field parameters slicer already takes care of the columns and rows to display.  What I need is a dynamic formula that will calculate the sum across each row based on what columns (severity levels) the user selects (or is made visible).

 

SEV1 has no data

 

lbendlin_0-1739229614099.png

 

Anonymous
Not applicable

Note:  The values I'm using in the field parameters are measures.  They do not directly come from a table.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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