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
manoj_0911
Advocate V
Advocate V

Need help calculating % of Status Duration per Agent (each agent should total 100%) when multiple ag

Hi Community,

 

manoj_0911_1-1761578873955.png

 

I’m trying to calculate % of Status Duration per Agent in Power BI.

I have a table visual with the following columns:

  • Date

  • Supervisor

  • Agent Name

  • Primary Status

  • Secondary Status

  • Status Duration (Seconds)

  • % of Status Duration (Expected Output)

My goal is:
When I select multiple agents in filters, the percentage for each agent should total 100% independently, not combined.


🔹 Example

If I filter two agents — Agent 4 DEV and Agent 4 QA:

Date Supervisor Agent Secondary Status Status Duration (s) Expected %

2025-09-15CristinaAgent 4 DEVAvailable47,64087.02%
2025-09-15CristinaAgent 4 DEVSpec Proj6,79912.98%
2025-09-15CristinaAgent 4 QAAvailable24679.87%
2025-09-15CristinaAgent 4 QASpec Proj6220.13%

Each agent should sum to 100% individually, even when multiple are visible.


🔹 Data Model Info

 

manoj_0911_0-1761578810667.png

 

🔹 Filters in the report

Date, Division, Group, Work Team, Manager, Supervisor, Agent, Employee ID, Primary Status, Secondary Status.

 


Question

How can I calculate

% of Status Duration = Status Duration / Total Duration (per agent)
so that each agent’s statuses sum to 100% independently, even when multiple agents are visible or filtered?

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@manoj_0911 assuming the output I shown is what you are looking for, use following DAX measures: please change name as per your needs:

 

//create a base measure total duration
Sum Total Duration (Parv) = 
SUM ( AG2_STATUS_SUBHOUR_V[TOTAL DURATION] )

//% measure for each agent

% of Status Duration (Parv) = 
DIVIDE ( 
    [Sum Total Duration (Parv)],
    CALCULATE ( 
            [Sum Total Duration (Parv)],
            ALLSELECTED (),
            VALUES ( PERSONS_V[AGENT] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

10 REPLIES 10
parry2k
Super User
Super User

@manoj_0911 Well, years of experience working with DAX. Not sure what else to tell - people don't pay attention to modelling and basics of DAX (row and filter context), once you have a handle on that, then it is a matter of time and you will get the hang of it.

 

ChatGPT - I haven't tried, and not sure how it will work until it knows the full context, when I say context, meaning understanding the model and how data is getting visualized. There are many moving components. That's why when I provide a solution, I don't jump on it until I have the full picture. On the surface, this all looks easy, and a lot of people jump on the solution. As my first reply to your post was, please share a sample PBIX, although I could have provided you with the solution by reading your post, but not without knowing the full details.

 

Sorry for the long reply, just sharing the process and building blocks to solve the issue. 🙂



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks a lot!

parry2k
Super User
Super User

@manoj_0911 sure, basically for the denominator with allselected  function, we are getting the sum of total hours of all selected, and then we are applying the agent filter back using the values function so that we get total hours of the agent in the context. I hope it is clear. Let me know if you need further clarification.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you so much where do you learn these, i was digging deep in chatgpt for hours but the solution it gave didnt work.

parry2k
Super User
Super User

@manoj_0911 assuming the output I shown is what you are looking for, use following DAX measures: please change name as per your needs:

 

//create a base measure total duration
Sum Total Duration (Parv) = 
SUM ( AG2_STATUS_SUBHOUR_V[TOTAL DURATION] )

//% measure for each agent

% of Status Duration (Parv) = 
DIVIDE ( 
    [Sum Total Duration (Parv)],
    CALCULATE ( 
            [Sum Total Duration (Parv)],
            ALLSELECTED (),
            VALUES ( PERSONS_V[AGENT] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

how to explain this technically

Ahmedx
Super User
Super User

pls try

 

parry2k
Super User
Super User

@manoj_0911 is this the output you are looking for, given the current selection of two agents:

 

parry2k_0-1761581361999.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

yes , how you did this , please share 

parry2k
Super User
Super User

@manoj_0911 It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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