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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AJMquillen87
Frequent Visitor

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

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

 

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

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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