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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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