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

"Pivoting" a table using DAX

Pivoting a table to use in a Histogram
2 hours ago

Hello, my data currently looks like this. 

AgeCount
233020
454736
572987

 

Basically, the client counted buyers by buyer age. I want to show this count in a histogram, with age buckets like ">20", "20-29", etc. To do this, I used a DAX calculated column. The client also wants to see percentages, so I created another DAX calculated column that takes each Count value and divides it by the total Count column sum. The table looks like this now. 

Age

Count

Age Bucket

Percentage
233020

20-29

12%
45473640-4915%
57298750-596%

 

However, the client wants a table on the dashboard that looks like this: 

Metric

20-2940-4950-59
Count302047362987
Percentage12%15%6%

 

Is there a good way to do this, I am currently exploring using SUMMARIZECOLUMNS.

 
1 ACCEPTED SOLUTION
whitch
Resolver I
Resolver I

In the formatting options for a matrix, under 'values' theres a 'show on rows' option.  If you turn this on, then put [Age Bucket] in columns and both [Count] and [Percentage] in values, then this should get you the result you want.  You may have to make Count and Percentage measures, but these can just be like:

CountMeasure = SUM('YourTableName'[Count]) 

View solution in original post

1 REPLY 1
whitch
Resolver I
Resolver I

In the formatting options for a matrix, under 'values' theres a 'show on rows' option.  If you turn this on, then put [Age Bucket] in columns and both [Count] and [Percentage] in values, then this should get you the result you want.  You may have to make Count and Percentage measures, but these can just be like:

CountMeasure = SUM('YourTableName'[Count]) 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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