Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Percentage measures per year for linechart

Hello,

 

I'm trying to create a linechart like this

 

JayQueue_0-1612431601512.png

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
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Sample data is this.

41.png

 

The measures are

a% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="a")),COUNTROWS('Table'))
b% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="b")),COUNTROWS('Table'))

40.png

 

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.

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Sample data is this.

41.png

 

The measures are

a% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="a")),COUNTROWS('Table'))
b% = DIVIDE(COUNTROWS(FILTER('Table',[Category]="b")),COUNTROWS('Table'))

40.png

 

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.

amitchandak
Super User
Super User

@Anonymous ,

 

Try a meausre like

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

Anonymous
Not applicable

Thanks @amitchandak 

I'm almost there I think

Now I got this

JayQueue_0-1612433922171.png

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"))

 

Then I use your measure

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?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.