Forum Discussion

wicker's avatar
wicker
Frequent Visitor
8 years ago
Solved

Countrows with creating pivot table

I have table from screenshot and want to recieve something like this:

 

ID             IN       OUT

534303      8           0

61486        0           8

1010454    3           0

2018139    7           4

etc...

 

I've tried to create another table with distinct values from one of this columns, but then I can't create two active relationships with the first table

  • Hi wicker,

     

    I don't understand completly the question please explain me the following.

     

    • Your two columns are filled with the same numbers correct?
    • The result below means that the 1010454 is 3 times in the first columns and 0 times in the second column

      ID             IN       OUT

      1010454    3           0

    If this is the case the easist way is to unpivot both columns and then make a visual table based on the attribute column:

     

    See attach PBIX file with example.

     

    Regards,

    MFelix

     

     

2 Replies

  • Hi wicker,

     

    I don't understand completly the question please explain me the following.

     

    • Your two columns are filled with the same numbers correct?
    • The result below means that the 1010454 is 3 times in the first columns and 0 times in the second column

      ID             IN       OUT

      1010454    3           0

    If this is the case the easist way is to unpivot both columns and then make a visual table based on the attribute column:

     

    See attach PBIX file with example.

     

    Regards,

    MFelix

     

     

    • wicker's avatar
      wicker
      Frequent Visitor

      Yes, you are understand me correct, thanks!