Forum Discussion
Calculate Percentage
- 1 year ago
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
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.
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-menakakota1 year agoCommunity 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.
- vincenttys1 year agoHelper I
Hi v-menakakota
Thanks for getting back to me so quickly.
My table would have week ending on the columns pane.
I hope that makes sense—please let me know if you need clarification.
Thank you
- v-menakakota1 year agoCommunity Support
Hi vincenttys ,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Thank you