cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ElQuon11
New Member

Power BI - Switch values to column

Hello all, I would like to do the change below:

ElQuon11_1-1650351216222.png

I have the data in Power BI from the left and would like to have a visualization on the right.
To precise the data like 2106 are words, not number. Also for some items on my list, I don't have ""Gate 2" so it will be NA.


I checked alreay online but couldn't find solutions...

 

Can you please help me?

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @ElQuon11 ;

We could create a new table by dax.

Table 2 = 
var _a=SUMMARIZE(FILTER('Table',[Gate1]<>BLANK()),[Gate1],[Title],"Gate","Gate1")
var _b= SUMMARIZE(FILTER('Table',[Gate2]<>BLANK()),[Gate2],[Title],"Gate","Gate2")
var _c= EXCEPT(SUMMARIZE( SUMMARIZE( GENERATESERIES(2102,2112,1),[Value],"1",FORMAT([Value],"0")),[1]),UNION(VALUES('Table'[Gate1]),VALUES('Table'[Gate2])))
return UNION(_a,_b, SUMMARIZE( _c,[1],"Title",BLANK(),"Gate",BLANK()))

Then create a index column.

Index = RANKX(ALL('Table 2'),[Title])

Put it into matrix then aujust it.

vyalanwumsft_0-1650609711702.png

steped layout ->off; wrap-> off;icon-> off;

vyalanwumsft_1-1650609739168.pngvyalanwumsft_2-1650609753492.pngvyalanwumsft_3-1650609775889.png

vyalanwumsft_4-1650609883079.png

The final output is shown below:

vyalanwumsft_5-1650609901613.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @ElQuon11 ;

We could create a new table by dax.

Table 2 = 
var _a=SUMMARIZE(FILTER('Table',[Gate1]<>BLANK()),[Gate1],[Title],"Gate","Gate1")
var _b= SUMMARIZE(FILTER('Table',[Gate2]<>BLANK()),[Gate2],[Title],"Gate","Gate2")
var _c= EXCEPT(SUMMARIZE( SUMMARIZE( GENERATESERIES(2102,2112,1),[Value],"1",FORMAT([Value],"0")),[1]),UNION(VALUES('Table'[Gate1]),VALUES('Table'[Gate2])))
return UNION(_a,_b, SUMMARIZE( _c,[1],"Title",BLANK(),"Gate",BLANK()))

Then create a index column.

Index = RANKX(ALL('Table 2'),[Title])

Put it into matrix then aujust it.

vyalanwumsft_0-1650609711702.png

steped layout ->off; wrap-> off;icon-> off;

vyalanwumsft_1-1650609739168.pngvyalanwumsft_2-1650609753492.pngvyalanwumsft_3-1650609775889.png

vyalanwumsft_4-1650609883079.png

The final output is shown below:

vyalanwumsft_5-1650609901613.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.