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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate a row percentage based on Matrix columns

Hi I need help.

 

I'm trying to turn this matrix

RemoteDesk_0-1660255115625.png

Into this matrix

RemoteDesk_1-1660255168525.png

I want to be able to calculate the percentage completed for jan, feb, mar and so on while being able to exclude a specific row from the calculation. for example, montreal should not have data for mar so the overall percentage for mar should be based 4 cities instead of 5. Is this possible in power bi?

 

Thank you all for your assistance.

5 REPLIES 5
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1660874336935.png

Here are the steps you can follow:

1. Create calculated table.

Table1 =
var _table1=
SUMMARIZE('Table','Table'[Date],
"cities","%completed",
"Amount",
FORMAT(
DIVIDE(
COUNTX(FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))&&'Table'[Amount]<>0),[Amount]),
COUNTX(FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))),[cities])),"Percent"))
return
UNION('Table',_table1)

2. Result:

vyangliumsft_1-1660874336940.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Hi @Anonymous 

Thanks so much for your response. The solution you gave looks great and as I can see it produced my desired results.

However, it'll be a bit difficult for me to reproduce without ome tweeks. Yours are all from one table, mine are from 3 different tables.

So for the first part of my issue which is simpler than the second part. Using the same scenario, cities is in one table, months from a date table, and the amount is a measure calculated for yet another table. Can you please point me in the right direction on how to put these tweeks in, thanks so much.

Also, in your data, can you make Montreal for march to be null (nothing) not 0 so it doesn't get counted when computing the %completed for that month.

Anonymous
Not applicable

Thanks for your response @Ashish_Mathur. Unfortunately I cant share the PBI file due to privacy concerns, wish I could. But can you give me a step by step on how I can do this if its possible? Thanks so much for your assistance.

Share anonymised data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors