cancel
Showing results for
Did you mean: Frequent Visitor

## Percentage measures per year for linechart

Hello,

I'm trying to create a linechart like this We have a total of "Manier van aanvragen" per year.

In 2015 45,74% was "Aantal via brief of mail", 28,76% was "aantal via thuisloket" and 25,50% was "aantal via loket"

2016: 28,70%...

I'm struggling with the measures. How do I approach this best?

I counted the rows but how do I count per year?

1 ACCEPTED SOLUTION  Community Support

Hi @JayQueue ,

Sample data is this. The measures are

``a% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="a")),COUNTROWS('Table'))``
``b% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="b")),COUNTROWS('Table'))`` You can check more details from here.

Best Regards,

Stephen Tao

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

3 REPLIES 3  Community Support

Hi @JayQueue ,

Sample data is this. The measures are

``a% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="a")),COUNTROWS('Table'))``
``b% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="b")),COUNTROWS('Table'))`` You can check more details from here.

Best Regards,

Stephen Tao

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

Try a meausre like

divide([measure], calculate([measure], allexcept(Table, Table[year]))

Proud to be a Super User! Frequent Visitor

Thanks @amitchandak

I'm almost there I think

Now I got this But the percentage should be 100% combined as there are only 2 types of "Groep". I can't seem to find why 😕

Counting all rows:

``Alles = CALCULATE(COUNT('vw_EGOV'[groep]))``

Counting rows of Groep "Thuisloket"

``Thuiswerk = CALCULATE(COUNT('vw_EGOV'[groep]),FILTER(vw_EGOV,vw_EGOV[groep]="Thuisloket"))``

Counting rows of Groep "Andere"

``Andere = CALCULATE(COUNT('vw_EGOV'[groep]),FILTER(vw_EGOV,vw_EGOV[groep]="Andere"))``

``count per year Thuisloket = divide([Thuisloket], CALCULATE([Alles], ALLEXCEPT('Date table Datum','Date table Datum'[Year])))``
``count per year Andere = divide([Andere], CALCULATE([Alles], ALLEXCEPT('Date table Datum','Date table Datum'[Year])))``

What am I missing here?  Announcements #### Welcome to the User Group Public Preview  