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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Help with Formatting a Dataset

Hello,

I am working on formatting the below sample dataset:

IDKeyValue
123StatusActive
123CountryUSA
456StatusInactive
456CountryCanada

 

This is what I want the table to look like:

IDStatusCountry
123ActiveUSA
456InactiveCanada

 

I have tried using Pivot Column on the Key column from fig.1 and this is what I get:

IDStatusCountry
123Activenull
123nullUSA
456Inactivenull
456nullCanada

 

I think im close and im probably missing a pretty easy step, but any help would be greatly appreciated!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

There two options.

1. Pivot the data with advance option as No summarization/Aggeration. Under Edit Queries or Transform data.

2. Or display it in Matix with First Agg on Values.

 

Screenshot 2020-01-12 09.26.42.pngScreenshot 2020-01-12 09.28.15.pngScreenshot 2020-01-12 09.28.23.pngScreenshot 2020-01-12 09.37.07.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Try

Summ = SUMMARIZE(transpose,transpose[personID],transpose[Org],transpose[updatedAt],"Status",maxx(filter(transpose,transpose[Key]="Status"),transpose[Value]), "Country",maxx(filter(transpose,transpose[Key]="Country"),transpose[Value]))

 

Check : https://www.dropbox.com/s/hqlasw6q9smkybr/Transpose.pbix?dl=0

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

There two options.

1. Pivot the data with advance option as No summarization/Aggeration. Under Edit Queries or Transform data.

2. Or display it in Matix with First Agg on Values.

 

Screenshot 2020-01-12 09.26.42.pngScreenshot 2020-01-12 09.28.15.pngScreenshot 2020-01-12 09.28.23.pngScreenshot 2020-01-12 09.37.07.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for your response @amitchandak . I have tried using pivot column with Dont Aggregate selected under Advanced Options. This is when I get multiple entries for the same user and null as their values (figure 3 in original post). Perhaps I made an error in my initial post by oversimplifying my dataset. This is an actual representation of the dataset, with this sample, I receive multiple entries for the same ID with null in the value columns:

 

_idKeyOrgpersonIDupdatedAtValue
a;kljsd;fjsd;fStatus12345671231/1/2000Active
askldf;asdfjkCountry12345671231/1/2000USA
sklafh;kfg;akStatus12345674561/2/2000Inactive
skdf;klasdfjCountry12345674561/2/2000Canada

 

The _id field is a generic guid assigned uniquely and randomly to every row in the table. When I pivot with Dont Aggregate selected, this is my result:

 

_idorgpersonaIDupdatedAtStatusCountry
a;kljsd;fjsd;f12345671231/1/2000Activenull
askldf;asdfjk12345671231/1/2000nullUSA
skdf;klasdfj12345674561/2/2000nullCanada
sklafh;kfg;ak12345674561/2/2000Inactivenull

 

I want to combine everything on the personaID and I think the _id field is getting in the way. Other than deleting the _id column, is there a way to further aggregate or group on the personaID?

Try

Summ = SUMMARIZE(transpose,transpose[personID],transpose[Org],transpose[updatedAt],"Status",maxx(filter(transpose,transpose[Key]="Status"),transpose[Value]), "Country",maxx(filter(transpose,transpose[Key]="Country"),transpose[Value]))

 

Check : https://www.dropbox.com/s/hqlasw6q9smkybr/Transpose.pbix?dl=0

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.