Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Problems with The Visualization of a Measure With Percentage Variables

Good! []
The consultation is in order to better organize the measures.
I have several measures to achieve a visualization and I want to group it into a single measurement.
That is, I have several measurements with the required visualization and I look for the same with a single calculation.

The next measure is repeated for the different clients, resulting in the graph below.
For both Orange and the rest (Blue, Violet, green, red) the measure is the same.

%PAYMENT. ORANGE = DIVIDE(CALCULATE(PAYMENTS)[TOTAL],PAYMENTS[CUSTOMER]="ORANGE"),
CALCULATE(PAYMENTS[TOTAL],ALL(PAYMENTS)))

correcto.JPG

I cannot group them into a single measure, and thus avoid replicating 6/7 times the same measure for each client.
I have tried but the closest thing to the required result is the following.
intento.JPG

I can't see the monthly representation (%) of each customer in the total as in the first chart.

Clarification: I seek to replicate what a Column Chart does 100% applied with the ribbon chart.

  • v-jingzhang's avatar
    v-jingzhang
    4 years ago

    Hi Syndicate_Admin 

     

    Sorry for the late reply. I misunderstood it previously. Please try this new measure. The updated pbix file is attached. 

    Measure 2 = 
    VAR monthTotal = CALCULATE(SUM(Payments[Amount]),ALL(Payments[Customer]))
    VAR customerTotal = SUM(Payments[Amount])
    RETURN
    DIVIDE(customerTotal,monthTotal)

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

12 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Syndicate_Admin 

     

    Try this measure and put CUSTOMER column into Legend card. 

    %PAYMENT =
    DIVIDE (
        CALCULATE ( PAYMENTS[TOTAL] ),
        CALCULATE ( PAYMENTS[TOTAL], ALLEXCEPT ( PAYMENTS, PAYMENTS[Month] ) )
    )
    

     

    Let me know if you still have questions. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Good!
      Thanks for helping.
      It did not give me the expected result to use allexcept in the measure.
      I keep trying other variants.

      Best regards.

      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        Hi Syndicate_Admin 

         

        Can you provide some sample data and the single measure you used to get the closest result in the second image? I guess when you group them into a single measure, it may calculate the % of the total across all months rather than every single month. 

         

        BR,

        Jing

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Good!
      I took the time to do it as it is by creating a "Year-Month" column even.
      I still don't see the expected result.
      intento2.JPG

      I do not achieve that per month the % per Client represents the total of 100%.

      Best regards.

      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        Hi Syndicate_Admin 

         

        Sorry for the late reply. I misunderstood it previously. Please try this new measure. The updated pbix file is attached. 

        Measure 2 = 
        VAR monthTotal = CALCULATE(SUM(Payments[Amount]),ALL(Payments[Customer]))
        VAR customerTotal = SUM(Payments[Amount])
        RETURN
        DIVIDE(customerTotal,monthTotal)

         

        Best Regards,
        Community Support Team _ Jing
        If this post helps, please Accept it as Solution to help other members find it.

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Syndicate_Admin 

     

    Sorry I don't understand what you mean by "But I have related the following calendar table, filtering by calendar(date)". You relate the data table to calendar table, right? What is or should be filtered by date? Where is the filter? Can you provide some sample data or maybe a simple .pbix file to help elaborate it more? 

     

    BR,

    Jing

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      I explain, in your pbix file. you put Month. In my Payments table, the date (dd/mm/yy) is the column related to that calendar table.
      Calendar[date] 1:* Payments(Date).
      Then, I use the calculation equal to or similar to the one you performed. I add it as a measure to a table of ribbons, with axis of Calendar Hierarchy of Year and Month and the legend of Customers.

      Thank you for your time again.