Forum Discussion

onernoa's avatar
onernoa
New Member
4 years ago
Solved

% of Total Measure

Hello All

 

I would like to know the % of gr_qty to total for each article in each fiscal week ending dte. 

 

In fiscal week ending date 09/07/2022

Site 1 recevied 5 of article 'a'

All Sites received 14 (5 + 7 + 2) of article 'a'

I would like a column that calculates (5 /14) for row 1, (7/14) for row 2, (2/14) for row 3, (6/19) for row 4 and so on.

 

sitefiscal_week_ending_dtearticlegr_qty

1

09/07/2022a

5

209/07/2022a7
309/07/2022a2
109/07/2022b6
209/07/2022b5
309/07/2022b8
102/07/2022a4
202/07/2022a4
302/07/2022a7
102/07/2022b7
202/07/2022b5
302/07/2022b7

 

Thanks in advance!

onernoa 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi

     

    Try something like this DAX measure:

     

     

    DIVIDE(
        CALCULATE(
            sum(your_table[gr_qty])
        ),
        CALCULATE(
            sum(your_table[gr_qty]),
            ALL(your_table[site])
        )
    )

     

    Kind regards,
    José
    Please mark this answer as the solution if it resolves your issue.
    Appreciate your kudos! 🙂

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi

     

    Try something like this DAX measure:

     

     

    DIVIDE(
        CALCULATE(
            sum(your_table[gr_qty])
        ),
        CALCULATE(
            sum(your_table[gr_qty]),
            ALL(your_table[site])
        )
    )

     

    Kind regards,
    José
    Please mark this answer as the solution if it resolves your issue.
    Appreciate your kudos! 🙂

     

    • onernoa's avatar
      onernoa
      New Member

      Thank you! I was over complicating it so much. Have a great day, José.