graphpowerbidaxreportvisualization

Why does my column chart show 100% for each category that I want to show?


I am trying to create a bar and line chart, for the bar chart, I want to show the split between Complete and Incomplete ( my categories) in %, however, my bar chart is showing me 100% for both categories and the total bar adds up to 200%. I want to create a 100% stacked bar chart that will show me the split between Complete and Incomplete

Bar Chart showing 200%

This is the code for this measure I wrote:

Measure try =
Var Total = CALCULATE(DISTINCTCOUNT('PM Checklist vs Last SP Used'[Install Base]), FILTER('PM Checklist vs Last SP Used','PM Checklist vs Last SP Used'[PM Complete?] = "Complete")) + CALCULATE(DISTINCTCOUNT('PM Checklist vs Last SP Used'[Install Base]), FILTER('PM Checklist vs Last SP Used','PM Checklist vs Last SP Used'[PM Complete?] = "Incomplete"))
Return DIVIDE(DISTINCTCOUNT('PM Checklist vs Last SP Used'[Install Base]),Total)

I placed this measure under Values, hoping that my Legend Field can help me distinguish those that are complete vs incomplete


Solution

  • Your var Total is being filtered too. Try:

    var total =
      CALCULATE(
        DISTINCTCOUNT('PM Checklist vs Last SP Used'[Install Base]),
        REMOVEFILTERS('PM Checklist vs Last SP Used'[PM Complete?])
      )