Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Show Percentages per month

Can someone assist me with a DAX / or the correct approach if I want to show the percentages per month in a line chart? 

 

The problem I am facing is that it divides the percentage within the whole timeframe selected, instead I want each month to be 100% and show me the different types within that month summing up to 100%. 

 

Please see screenshot of an example data and the current problem I am facing in the line chart. 

 

DataResult

 

Axis: Month-Year

Legend: Type

Values: Total

 

Thanks in advance.

  • Hi Anonymous ,

     

    Selected the Stacked area chart and the use the following measure on your values:

     

    Total total for Month-Year = 
    SUM('Table'[Total]) / CALCULATE(SUM('Table'[Total]);ALL('Table'[Type]))

    If you want the measure to calculated based on a filter of type you can redo the measure to:

     

    Total total for Month-Year selected = 
    SUM('Table'[Total]) / CALCULATE(SUM('Table'[Total]);ALLSELECTED('Table'[Type]))

    Regards,

    MFelix

3 Replies

  • Hi Anonymous ,

     

    Selected the Stacked area chart and the use the following measure on your values:

     

    Total total for Month-Year = 
    SUM('Table'[Total]) / CALCULATE(SUM('Table'[Total]);ALL('Table'[Type]))

    If you want the measure to calculated based on a filter of type you can redo the measure to:

     

    Total total for Month-Year selected = 
    SUM('Table'[Total]) / CALCULATE(SUM('Table'[Total]);ALLSELECTED('Table'[Type]))

    Regards,

    MFelix

    • Anonymous's avatar
      Anonymous
      Not applicable

      Appreciate it MFelix , it worked perfectly!

       

      Thanks,

    • Anonymous's avatar
      Anonymous
      Not applicable

      MFelix 

       

      My data is little different, I tried modifying the DAX but the Acual % is showing Acutal 100% for itself which is not correct. 

       

      My data looks something like this, Planned is coming from one table and Actual from other which i have connected over date table.

       

      'll be ploting % values on weekend dates and by months Bins on Clustered column chart, or in table showing % work done that Weekend date or on the Month bin date.

       

      Like here for example , In Sept Total Planned = 57 , Total Actual = 59  .So Total effort = (59/57)*100 = 103% work and for the month of Sept actual % = 47%. I am having difficulty preparing DAX for that.

      Also for Running total, I just used the running total Quick measure for Planned , But for Actual, since it is dividing by itself by End of Sept running total is showing 100% where as it should be 47.58%