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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Split table into columns based on unique values

Hi guys,

 

I'd like to split this dummy table into several columns and populate with 1's and 0's, based on the unique values in the Year/Qtr column.

 

Current layout

NameYear/Qtr
Dave2021Q1
John2021Q1
John2021Q2
Patricia2021Q3
Patricia2021Q4
Claire2022Q1
Dave2022Q2
Claire2022Q3
Claire2022Q4

 

Desired layout

Name2021Q12021Q22021Q32021Q42022Q12022Q22022Q32022Q4
Dave1----1--
John11------
Patricia--11----
Claire----1-11

 

or

 

Name2021Q12021Q22021Q32021Q42022Q12022Q22022Q32022Q4
Dave1----1--
John11------
John11------
Patricia--11----
Patricia--11----
Claire----1-11
Dave1----1--
Claire----1-11
Claire----1-11

 

The only difference in the two is that the second desired layout uses the same rows as the current layout.

 

What's key here is that I need it to create columns based on unique values, hence no hardcoding of columns as that would force me to re-code the query as soon as a new quarter starts.

 

Thank you so much for the help!

1 REPLY 1
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Create a new measure like this:

_countName = DISTINCTCOUNT(yourTable[Name])

 

Then put it all into a matrix visual like this:

BA_Pete_0-1676370561586.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.