Forum Discussion
Rahul66303
8 years agoFrequent Visitor
Need help - Pivot with if exist
Hi All,
Need a help with if Exist in DAX, below is my problem statement :
I need to pivot two columns in my table for below data :
| Channel | Value |
| Channel | one |
| Channel | one |
| Channel | one |
| Channel | one |
| Channel | one |
| Channel | two |
| Channel | two |
| Channel | two |
| Channel | two |
After pivot above columns it should transform as per below :
| Channel |
| one |
| one |
| one |
| one |
| one |
| two |
| two |
| two |
| two |
But if Column Channel already exists then it should not pivot instead it need to copy values from Value column.
Thanks,
Rahul
3 Replies
- MFelixSuper User
- Rahul66303Frequent Visitor
Yes that is we can do pivot in query editor but my ask is before doing pivot it should check for column (in this case Channel) already exist on table if Yes then it should just copy the value of channel and discard pivot.
Channel Value Channel one Channel one Channel one Channel one Channel one Channel two Channel two Channel two Channel two - MFelixSuper UserNot really understanding your question, the query editor is like a macro so it always get the information in the.same format make the changes, formatting whatever you program it and repeat the process every time you refresh the data.
So if the source data is always in the format you present it will always be get on that way and then unpivoted.
Or are you getting information.on different formats each time?
Regards,
MFelix