Forum Discussion
Calculate Percentage
Hi all,
I am trying to achieve the outcome shown in the table below using Power BI. However, I'm having trouble calculating the % of delivered, which should be the sum of Delivered divided by the number of weeks.
The Panel column represents what is currently displayed in my Matrix table.
| Panel | ||||||||||
| Vendor | 19/04/2025 | 26/04/2025 | 03/05/2025 | 10/05/2025 | 17/05/2025 | 24/05/2025 | 31/05/2025 | % of delivered | Rows | |
| A | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 57.1% | Vendor | |
| B | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 28.6% | ||
| C | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 42.9% | Columns | |
| D | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 100.0% | WeekEnd | |
| Values | ||||||||||
| Measure - Delivered |
Any guidance would be appreciated!
Regards,
Vince
Hi all,
Apologies for the delayed reply—I've been flat out with work.
Thank you again for looking into my question. While I appreciate the suggested solutions, they didn’t quite meet my requirements. I ended up creating another visual to show the overall YTD percentage.
Thanks again for your support.
Best regards,
Vince
15 Replies
- ajaybabuinturiSuper User
Hi vincenttys,
Wanted to let you know that you can use below measure to achive your requirement.
% Delivered = VAR TotalWeeks = CALCULATE( DISTINCTCOUNT('YourTable'[Date]), REMOVEFILTERS('YourTable'[Vendor]) -- count across all vendors ) VAR DeliveredCount = SUM('YourTable'[Delivered]) RETURN DIVIDE(DeliveredCount, TotalWeeks)Matrix Chart Field Details
Rows: Vendor
Columns: WeekEnd Date
Values:
Delivered (as is)
% Delivered (the above DAX measure)
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.- vincenttysHelper I
Thanks for getting back to me so quickly.
I’d like to display only the % Delivered as a single column. Currently, I’m showing Week 1 with both Delivered and % Delivered, followed by Week 2 with the same format, and so on.
I hope that makes sense—please let me know if you need clarification.
Thank you
- v-menakakotaCommunity Support
Hi vincenttys ,
Thanks for reaching out to the Microsoft fabric community forum.Use the following measure:
% Delivered =
VAR DeliveredCount = SUM('YourTable'[Delivered])
VAR TotalWeeks = CALCULATE(DISTINCTCOUNT('YourTable'[WeekEnd]), REMOVEFILTERS('YourTable'[Vendor]))
VAR Result = DIVIDE(DeliveredCount, TotalWeeks)
RETURN
IF(
ISINSCOPE('YourTable'[Vendor]),
Result,
BLANK()
)Take a Matrix visual and add following fields:
- Rows: Vendor
- Values: % Delivered (Only this measure)
- Go to the Fields pane on the right side.
- Click on the %Delivered measure. Set the Data Type to Decimal Number (if it's not already), and then set Format to Percentage with 1 decimal place, for example.
Please go through the screenshot and document for more information:
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.
- pankajnamekar25Super User
Hello vincenttys
try this measure
% Delivered =
VAR DeliveredCount = SUM('YourTable'[Delivered])
VAR WeekCount = CALCULATE(
DISTINCTCOUNT('YourTable'[WeekEnd]),
ALLSELECTED('YourTable'[WeekEnd])
)
RETURN
DIVIDE(DeliveredCount, WeekCount)
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
- vincenttysHelper I
Thanks for getting back to me so quickly.
I’d like to display only the % Delivered as a single column. Currently, I’m showing Week 1 with both Delivered and % Delivered, followed by Week 2 with the same format, and so on.
I hope that makes sense—please let me know if you need clarification.
Thank you
Regards
Vince
- RicoZhouFrequent Visitor
Hi vincenttys ,
I think you can show % of delivery in subtotal position.
You can try measure as below.
Measure = VAR _Count = CALCULATE(COUNT('Table'[Weekend]),FILTER('Table','Table'[Value] = 1))+0 VAR _Total = CALCULATE(COUNT('Table'[Weekend])) RETURN IF( HASONEVALUE('Table'[Weekend]),_Count, FORMAT(DIVIDE(_Count,_Total),"0.0%"))Result is as below.
Best Regards,
Rico Zhou
- vincenttysHelper I
Hi RicoZhou ,
Are you able to give me more guidance as i am pretty new to this?
Currently, i have huge table that contain the data which have week ending for each records and whether it is delivered - that column will show 1 if delivered and 0 otherwise.
Example Week 1, i have 3 vendors A, B and C and in Week 1
Vendor A have 3 delivered, Vendor B have 0 delivered and Vendor C have 2 delivered.
My measure will have "delivered count" which is the average as i just want to show 1 and 0 for the week for either delivered or not.
The next step is i will have a matrix table with vendor in rows and week ending for current FY in columns as my original post stated.
Now i want to add % delivered for current FY.
I think your idea of showing % of delivery in subtotal position is what i want but i am not sure how to get there.
Thanks again for helping.
Regards,
Vince
- IrwanSuper User
hello vincenttys
please share a sample data that represent your original table along with the outcome you expected from the sample data your provided.
otherwise experts that have been helped you can only guess your issue based on your description.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...Thank you.
- vincenttysHelper I
Hi all,
Apologies for the delayed reply—I've been flat out with work.
Thank you again for looking into my question. While I appreciate the suggested solutions, they didn’t quite meet my requirements. I ended up creating another visual to show the overall YTD percentage.
Thanks again for your support.
Best regards,
Vince- v-menakakotaCommunity Support
Hi vincenttys ,
We really appreciate your efforts and for letting us know the update on the issue.
Please continue using fabric community forum for your further assistance.
If this is the solution that has worked for you please accept your reply as solution so as to help other community members who may face similar issue in the future.
Best Regards,
Menaka.
Community Support Team - v-menakakotaCommunity Support
Hi vincenttys ,
We really appreciate your efforts and for letting us know the update on the issue.
Please continue using fabric community forum for your further assistance.
If this is the solution that has worked for you please accept your reply as solution so as to help other community members who may face similar issue in the future.
Best Regards,
Menaka.
Community Support Team