Forum Discussion

NewbieJono's avatar
NewbieJono
Post Partisan
2 years ago
Solved

% Of total

Do you have any ideas on how I display the drill down as a percentage of the date total? e.g 

 

0-1 days - 42706 as a percentage of 42764

1-2 days 58 as a percentage of 42764

 

 

Thanks all

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi NewbieJono 

     

    Thanks for the reply from bhanu_gautam  and AilleryO .

     

    NewbieJono , the following steps are for your reference: 

     

    Sample:

     

    Create a measure as follows

     

    Measure = 
    VAR _sum = CALCULATE(SUM('Table'[Value]), ALL('Table'))
    RETURN
    IF(
        ISFILTERED('Table'[Type]),
        FORMAT(SUM('Table'[Value]) / _sum, "0.00%"),
        SUM('Table'[Value])
    )

     

     

    Output:

     

    Best Regards,
    Yulia Xu

     

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

4 Replies

  • NewbieJono , You can create a measure to calculate the percentage of each drill down category relative to number of days and pull that measure in visualization

  • AilleryO's avatar
    AilleryO
    Memorable Member

    Hi,

     

    It will look like something :

    % in a day =
    VAR TotalofDay = CALCULATE( [Total Qty] , ALL( 'Data Product'[Category] ) )
    RETURN
    DIVIDE( [Total Qty] , TotalofDay )
     
    With [Total Qty] being your measure (that gives 42076 and 58) and 'Data Product'[Category] being your "slicing" value (the one that shows 0-1 day and 1-2 days).
    In bold is what you need to replace with your own measures/columns.
    If there are more hierachical levels on your visuals, let us know because it might change the solution to adopt.
    Hope it helps, let us know
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi NewbieJono 

     

    Thanks for the reply from bhanu_gautam  and AilleryO .

     

    NewbieJono , the following steps are for your reference: 

     

    Sample:

     

    Create a measure as follows

     

    Measure = 
    VAR _sum = CALCULATE(SUM('Table'[Value]), ALL('Table'))
    RETURN
    IF(
        ISFILTERED('Table'[Type]),
        FORMAT(SUM('Table'[Value]) / _sum, "0.00%"),
        SUM('Table'[Value])
    )

     

     

    Output:

     

    Best Regards,
    Yulia Xu

     

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