Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Count / percentage

Hi,

I have a column with 3 different entries in it (Early, Late & On-Time). I'm looking to count the number of entries for each(Early, Late & On-time) and then have that as a percentage of the total amount of entries (i.e. 100 entries, 10 are on time, therefore return 10%) on a monthly basis graph.

Is this possible..?

In the first graph, the percentage of cases is divided on the whole.
But I am looking for something like the second image for evry month.

3 Replies

  • Without data it is tough to do the measure ... This is what I assume you need and providing the measure details and steps.

     

    Sample data

     

    what you have already is simple clustered column chart, with % of Grand Total chart

     

    What you want is % of Total within Group ... by month and category

    a) Measure

    % of Total within Group = 
    VAR _Grp = values(Table3[Date].[MonthNo])
    VAR _val = CALCULATE( sum(Table3[Total Entries]), ALLEXCEPT(Table3, Table3[Name]), _Grp)
    RETURN divide (sum(Table3[Total Entries]), _val)

     

    b) clustered column chart

     

    c) output 

     

     

    Hope this helps!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Sorry it didn't worked for me. Could you please explain the dax formula.

    Heer is the sample Data. Due to the security reasons, I cannot share the origincal data but  I have made some dummy data which looks similar to the orginical

    Unique IDID numberDate of surgical StartActual vs Scheduled Range
    2315912/12/2021On-time
    1235922/12/2021Delayed
    56953212/12/2021Delayed
    8541234/11/2021Delayed
    7456942/11/2021On-time
    7452352/10/2021Delayed
    7452152/10/2021early
    9563262/10/2021early
    4523179/10/2021On-time
    45284810/10/2021Delayed
    54165912/10/2021early
    4521394/16/2021Delayed


    Here is the  graph which i am able to get.

    In the image, if you see september, 14.33% of delayed, 0.28% of Early & on-time. I want it to be 96.29% of delayed & 1.85% of Early& on-time.

    Th output image you have provided is exactly what i am looking for my graph. However, I didn't understand what fields you are using.

    Appreciate your help.