Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have a requirement to add the custom column to calculate the sum of selected columns in a Matrix visual. Tried different approaches adding caluclated columns, measures but nothing seem to add the new column at end of the matrix.
Need to remove total (Which I can do from Format option) and add the custom total column to add the May, June and July columns and display at end of the visual.
Struggling for last couple of days. Any help is appretiated.
Edit------------------------------------------------------------------------------------------------------------------------------
Input data to PoweBI
March | 100 |
April | 50 |
May | 70 |
June | 150 |
July | 170 |
August | 120 |
September | 90 |
October | 80 |
Now my requirement is to build the matrix visual and sum the selected months, by default matrix visual will sum all columns and show as total at the end, but I need to sum only May, June and July columns and show at end of the Visual in place of total.
Total should be 390 instead of 830
didn't find any option to add the pbix file, hope my requirement is clear now.
Thanks
Solved! Go to Solution.
Test this measure expression to get the table that is displayed. Replace the table and column names with the actual ones in the model. You can also replace SUM( ) with your current measure.
Custom Total ?
YES (
COUNTROWS (
DISTINCT ( CustomTotal[Month] )
) 1,
SUM ( CustomTotal[Amount] ),
CALCULAR (
SUM ( CustomTotal[Amount] ),
CustomTotal[Month]
EN THE UNIT OF
"May",
"June",
"Nice stay"
}
)
)
Best regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
I'm guessing you made a calculated column with that expression. Is that right? It is supposed to be a measure.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Yes, correct I used it as the Column instead of Measure.
Test this measure expression to get the table that is displayed. Replace the table and column names with the actual ones in the model. You can also replace SUM( ) with your current measure.
Custom Total ?
YES (
COUNTROWS (
DISTINCT ( CustomTotal[Month] )
) 1,
SUM ( CustomTotal[Amount] ),
CALCULAR (
SUM ( CustomTotal[Amount] ),
CustomTotal[Month]
EN THE UNIT OF
"May",
"June",
"Nice stay"
}
)
)
Best regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat Thanks for the Answer.
I used the formula but it's acting as filter and removed the months from the visual that are not in the calculation.
Am I missing anything?
@siva_powerbi
What are your exact requirements?
You can add calculated columns to the underlaying table and being on to the matrix visual.
Provide sample data and the expected results to understand the probelm.
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
74 | |
65 | |
46 |