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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bschil98
Frequent Visitor

Implement Row Total for Table With Parameter as columns

I had a table that i pivoted on name that summarizes revenue. I added all the name columns to a parameter. Then, I put the parameter into the table so each name is listed as you can see below:

;bschil98_0-1684713235862.png

I then wrote a measure called "Revenue Sum" and added it as the last column of the table. The intention here is that it will sum every column that we added to the parmeter: 

Revenue Sum = SUMX('Sheet1 (3)','Sheet1 (3)'[Anna]+'Sheet1 (3)'[Bob]+'Sheet1 (3)'[Brooke]+'Sheet1 (3)'[Brent]+'Sheet1 (3)'[Bruce]+'Sheet1 (3)'[Cam]+'Sheet1 (3)'[Cami]+'Sheet1 (3)'[Dan]+'Sheet1 (3)'[Emma]+'Sheet1 (3)'[Eva]+'Sheet1 (3)'[Frank]+'Sheet1 (3)'[Garret]+'Sheet1 (3)'[Joe]+'Sheet1 (3)'[Kyle]+'Sheet1 (3)'[Meghan]+'Sheet1 (3)'[Philip]+'Sheet1 (3)'[Rachel]+'Sheet1 (3)'[Steve]+'Sheet1 (3)'[Ted]+'Sheet1 (3)'[Tom])


Lastly, when I filter on the parameter columns, the Revenue Sum measure doesn't adjust. As you can see, the totals remain the same for when all the parameter values are included:
bschil98_1-1684713531047.png

 

 

How can I write a measure/dax expression that included a total value for the all the parameterized columns that adjusts for when they are filtered out of the visualization.

 

Also, I can't use a matrix visual for this particular task although I know that would make things a lot easier

1 ACCEPTED SOLUTION
bschil98
Frequent Visitor

For those curious, I believe I found a solution that is so far working. First, I joined the base table (before pivot) to the parameter table on name in the model via manage relationships. Then, I wrote a measure that sums revenue in the base table and filters on all the columns I have in my finished visualization: sum 2 = CALCULATE(SUM(Sheet1[Revenue]), FILTER(Sheet1, Sheet1[Country]=SELECTEDVALUE('Sheet1 (3)'[Country]) && Sheet1[Project Name] = SELECTEDVALUE('Sheet1 (3)'[Project Name]) && Sheet1[Rev>Cost] = SELECTEDVALUE('Sheet1 (3)'[Rev>Cost]) && Sheet1[Column5] = SELECTEDVALUE('Sheet1 (3)'[Column5])))
This appears to be working for me
 

View solution in original post

2 REPLIES 2
bschil98
Frequent Visitor

For those curious, I believe I found a solution that is so far working. First, I joined the base table (before pivot) to the parameter table on name in the model via manage relationships. Then, I wrote a measure that sums revenue in the base table and filters on all the columns I have in my finished visualization: sum 2 = CALCULATE(SUM(Sheet1[Revenue]), FILTER(Sheet1, Sheet1[Country]=SELECTEDVALUE('Sheet1 (3)'[Country]) && Sheet1[Project Name] = SELECTEDVALUE('Sheet1 (3)'[Project Name]) && Sheet1[Rev>Cost] = SELECTEDVALUE('Sheet1 (3)'[Rev>Cost]) && Sheet1[Column5] = SELECTEDVALUE('Sheet1 (3)'[Column5])))
This appears to be working for me
 
bschil98
Frequent Visitor

https://community.powerbi.com/t5/Desktop/Passing-Parameters-in-measures/m-p/208276 only workaround ive found so far but it still hasnt led to a solution

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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