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
Saxon10
Post Prodigy
Post Prodigy

Unpivot row to column by using Union function

 

I have 4 columns are Type, Id, Area & result and those 4 columns return multiple values. I would like to group the Type, Id and Area.

 

I am looking for DAX column to achieve my final result.

 

Data

 

TYPE

ID

AREA

RESULT

TR

1

DD1

IND/001,PAK/008

TR

1

DD1

IND/001,PAK/008

TR

1

DD1

IND/001,PAK/008

TR

1

DD1

IND/001,PAK/008

TR

1

DD1

IND/001,PAK/008

TR

1

DD1

IND/001,PAK/008

TR

2

DD2

SRI/DMK

TR

3

DD3

AUS/101,USA/234

TR

3

DD3

AUS/101,USA/234

TR

3

DD3

AUS/101,USA/234

TR

3

DD3

AUS/101,USA/234

PTR

1

ED1

IND/001,PAK/008

PTR

2

ED2

SRI/DMK

PTR

3

ED3

AUS/101,USA/234

PTR

3

ED3

AUS/101,USA/234

PTR

3

ED3

AUS/101,USA/234

PTR

3

ED3

AUS/101,USA/234

 

Result

 

TYPE

ID

DD1

DD2

DD3

TR

1

IND/001,PAK/008

 

 

TR

2

 

SRI/DMK

 

TR

3

 

 

AUS/101,USA/234

TYPE

ID

ED1

ED2

ED3

PTR

1

IND/001,PAK/008

 

 

PTR

2

 

SRI/DMK

 

PTR

3

 

 

AUS/101,USA/234

 

I found similar query here but it was power query solution but I am looking DAX solution.

 

https://community.powerbi.com/t5/Desktop/Multiple-Rows-into-Multiple-Columns/m-p/543527

 

 

Any advise please.

 

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Can you live this solution?  You may download my PBI file from here.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

Thanks for your reply and help.

 

I would like to get the area according to the type but the current solutions the area showing top of the row.

 

Can you please advise.

 

This is I want get it based on my data.

 

Saxon10_0-1625314914991.png

 

Hi,

That cannot be done.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for your reply and sorry for the late respones.

 

The below mentioned article provide some solutions in table level but not in the visual.

 

Can you please help how can I get the same thing based on my datasource.

https://www.mrexcel.com/board/threads/convert-2nd-column-values-to-rows-when-column-1-is-the-same-na...

 

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.