Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Example table:
I am producing a pie chart to show the relationship of total payments for each category. I have four measures (one for each category).
Cat A = CALCULATE( SUM( 'Table'[Payment] ),' Table'[Category] = "Cat A" )
Cat B = CALCULATE( SUM( 'Table'[Payment] ),' Table'[Category] = "Cat B" )
Cat C = CALCULATE( SUM( 'Table'[Payment] ),' Table'[Category] = "Cat C" )
Cat D = CALCULATE( SUM( 'Table'[Payment] ),' Table'[Category] = "Cat D" )
Question 1: Is there a DAX formula that would eliminate the need to hard code the category name into the formula?
Question 2: I would like the formula to allow for dynamic addition of new categories.
Thank you.
Solved! Go to Solution.
Can you share a sample file?
The basic solution would be to just have a simple sum formula:
Payment Amounts =
CALCULATE(
SUM(Table[Payment])
)
Then use the category column in the legend section of the pie chart. That should give you the pie chat that you're looking for.
Can you share a sample file?
The basic solution would be to just have a simple sum formula:
Payment Amounts =
CALCULATE(
SUM(Table[Payment])
)
Then use the category column in the legend section of the pie chart. That should give you the pie chat that you're looking for.
Thank you! That does solve my problem. I now understand that there is no need to worry about the addition of new categories. I'm new to DAX and Power BI so sometimes the simple things are not so simple.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |