Forum Discussion

biswad's avatar
biswad
Icon for Advocate I rankAdvocate I
2 years ago
Solved

How to view row data as column without loosing duplicate raw values - Power bi

Hi Friends, 

 

I'm working on a dashboard where I have the data in this format t1. 

t1

BranchOfficialNameRole
BarnetDavidTreasure
BedfordMikeSecretary
AngleseyAndyPresident
BedfordJohnSecretary

 

I would like to view the data so that the roles becomes a column and show officials under each roles like this . I tried to use Pivot in my store precedure before brining this data into power bi but my only problem using Pivot is that I had to use Max(Officialname) and due to which official who has duplicate roles under same branch were excluded and showed me the first row. For example In the branch "Bedford" there are two "Secretary" roles under officialname "John" and "Mike", using pivot I was getting only "Mike", I was wondering if there are any option in Powerbi to represent the data as shown in the second table t2 please. Any help would be greatly appriciated.

t2

BranchTreasurerSecretaryPresident
BarnetDavid  
Bedford Mike 
Anglesey  Andy
Bedford John 

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi biswad ,

    Based on the information you provided, since the Rows of the matrix duplicate data will only be displayed once. You can add an index column. Use index and Branch as Rows.
    Final output:

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi biswad 

     

    Have you tried Pivoting the Role Column? you will have a different structure but you can keep the duplicates:

     

     

     

    • Uspace87's avatar
      Uspace87
      Icon for Resolver III rankResolver III

      Sorry I meant to Pivot Branch and select Role as Values Column awithout aggregation.

      • biswad's avatar
        biswad
        Icon for Advocate I rankAdvocate I

        Thank you, I have tried pivoting the branch, but I need to keep the same structure as shown in the second table, if I pivot the branch the branch name goes under "Treasurer","Secretary" and "President". I would like to keep official roles under each role.

  • Try this solution ...

    Click to download PBIX from OneDrive 

     

    How it works ...

    Use a Matrix visual ...

     

    Thanks for the clear description of the problem with example data. I wish everyone did that!

    Remember we are unpaid volunteers, and you have got free expert help which took a lot of effort,
    This solution works and does exactly what you asked.
    So please quickly click the [accept as solution] and the thumbs up button to leave kudos. 

    One question per ticket please. If you need to change or extend your request then please raise a new ticket.

    You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

    If you quote speedramps in your next tickets then I will then receive an automatic notification, and will be delighted to help you again.

    Please now click the [accept as solution] and the thumbs up button.  Thank you.

    • biswad's avatar
      biswad
      Icon for Advocate I rankAdvocate I

      Hi speedramps thank you for this , however in this case I loose the duplicate roles under the same branch, for example  "Bedford" there are two "Secretary" roles under officialname "John" and "Mike", using this option I am getting only "Mike" not "John", the result is similar to Pivot. This was my issue, I wanted to bring both "John" and "Mike", again thank you for trying to help me out, much appriciated.