Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

how to do percent line chart

i am pretty new to power BI. I am trying to make a lines chart of percentages over time.

my table has 

1) measure group

2) color (5 colors)

3) month/year date

 

i want 5 series lines with percentage values of count(Color1) / count(all Colors) % (for that month) etc etc

 

when i drop the colors column onto the chart i only get the options to do count or percentage of total count (over all time) - it has to be percentage of total count for THAT MONTH. so it seems i have to do a formula column and that it has to be done seperately for each color. 

 

 

  • RobbeVL's avatar
    RobbeVL
    7 years ago
    I noticed what you did wrong.
    A measure is not a calculated column. These are 2 different things.

11 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    We can create measure to work on it using the function COUNTROWS.

     

    Measure = DIVIDE(COUNTROWS('Table'),CALCULATE(COUNTROWS('Table'),ALL('Table')))

    • Anonymous's avatar
      Anonymous
      Not applicable

      the main issue i am having with this now is the "Values" of my Measure (under Axis)
      i am able to get a percent for the green line over time but the "Values" choices force me to pick 
      sum, avg, etc
      there is no option to NOT have those applied to my measure. if i pick avg it averages my percent accross all months. if i sum it sums up the percentage for each month.

      • RobbeVL's avatar
        RobbeVL
        Icon for Impactful Individual rankImpactful Individual

        Hi,

         

        Normally if you use a measure in your value field, you do not need to choose another measure. As the calculation is defined in your measure.

        Make sure your data is the correct field:
        Value : measure
        Axis : date

        legend : color