Forum Discussion

elaj's avatar
elaj
Helper IV
6 years ago
Solved

sorting grouped bar visual

Hello, i have another question.   my data: ID weight Category OC A 1 1,96481   OC_1   1 1,96481   OC_2   2 0,58651 Cat_1 OC_1 quoted 2 0,58651 Cat_1 OC_2 not qu...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi elaj ,

     

    We can create a calculate column and a calculate table to meet your requirement.

     

    Column =
    VAR x =
        CALCULATE (
            SUM ( test_multi_pivot[weight] ),
            FILTER (
                test_multi_pivot,
                test_multi_pivot[A] <> ""
                    && test_multi_pivot[Category] = "Cat_3"
                    && test_multi_pivot[OC] = EARLIER ( test_multi_pivot[OC] )
            )
        )
    VAR y =
        CALCULATE (
            SUM ( test_multi_pivot[weight] ),
            FILTER (
                test_multi_pivot,
                test_multi_pivot[A] = "quoted"
                    && test_multi_pivot[Category] = "Cat_3"
                    && test_multi_pivot[OC] = EARLIER ( test_multi_pivot[OC] )
            )
        )
    RETURN
        y / x

     

    Table 2 = SUMMARIZE(test_multi_pivot,test_multi_pivot[OC],test_multi_pivot[Column])

     

     

     

    Then you can use the [OC] column to create a relationship.

     

    If you have any question, please kindly ask here and we will try to resolve it.

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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