Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have data something like this and I would like to unpivot data as indicated below. Appreciate if anyone can help on this as when I tried to unpivot(unpivot only selected columns) the resulting output is not what I was expecting.
Data:
Cust Name State Measure 1 Name Measure 1 Value Measure 2 Name Measure 2 Value etc
======== ===== =========== ============ ============ =========== ===
Adventure TX Cust Service 85.34 Quality 93.78
Meta Yoga FL Cust Service 78.00 Quality 87.45
Expecting(unpivoted):
Cust Name State Measure Name Measure Value
======= ==== ========== ==========
Adventure TX Cust Service 85.34
Adventure TX Quality 93.78
etc...
Meta Yoga FL Cust Service 78.00
Meta Yoga FL Quality 87.45
etc...
Thanks in advance,
SN
Solved! Go to Solution.
I have found a way to get to your result, but surely there is a better option... Usually, unpivoting works well and is very simple, but like you mentioned, I am having issues getting your desired result through an unpivot alone. Maybe someone else can provide a cleaner solution, but until then:
Hi,
You may refer to my solution in this workbook.
Hope this helps.
Hi Ashish,
I am having same scenario, but still not able to resovle it.
Could you please share the solution in a PBIX format along with sample data file.
Thanks
Shishir
Hi,
Download the Excel file from the link in my previous post. Open PBI desktop and go to File > Import > Excel.
I will try it, but, Is it possible for you to send the file, as due to restrictions at work, unable to access the Drive location.
Thanks
Shishir
I have found a way to get to your result, but surely there is a better option... Usually, unpivoting works well and is very simple, but like you mentioned, I am having issues getting your desired result through an unpivot alone. Maybe someone else can provide a cleaner solution, but until then:
This is great and works for me(even though it is not an elegant way to do, I guess that is what "shaping" is all about). However, I was struggling a bit with custom column. I was using the DAX sort of syntax but after some time I realized need to use 'M' language. I used the below for ny custom column :
if Text.Start([Attribute],6) = [Attribute.1] then "Keep" else "Delete"
Thanks so much
-SN
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |