- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Performing calculation with a few conditions
Hello Everyone,
I'm looking for some help in performing a calculation in Power BI.
Raw data is an excel spreadsheet with extracted Salesforce data - and the columns I care about in this calculation are as follows:
- Case Age (calculated as a whole number in days)
- Reopened (data is displayed as '0' for no or '1' for yes)
What i'm trying to calculate is:
The total number of cases where both the Case Age and Reopened values are both 0; and take that number and divide it over the total number of cases that an agent handled (which could be the count of rows for either of the columns in question as each row would represent a case regardless).
For example:
Agent handled 100 cases this month; 3 were reopened and 86 were closed the same day (case age is 0). I want the result returned to be: 83 (Number of cases closed on the same day and were not reopened) divided over 100 (total cases handled) = 83%.
I appreciate any help in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Var bothZero =
Calculate(
Countrows( table ),
Table[Case Age] = 0,
Table[Reopened] = 0
)
Return
Divide(
AllZero,
Countrows( table )
)
Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @rgonzalez_rpra ,
I guess, you need to create the measures as per my understanding:
1. Total Cases Handled - DISTINCTCOUNT(Cases[CaseID])
2. Cases Closed Same Day, Not reopened -
ClosedSameDayNotReopened =
CALCULATE(
COUNTROWS(Cases),
Cases[CaseAge] = 0,
Cases[Reopened] = 0
)
3. % calculation
Pct_ClosedSameDayNotReopened =
DIVIDE(
[ClosedSameDayNotReopened],
[TotalCases],
0
)
Example:
I handled 10 cases
4 of them have caseage = 0 and reopened = 0
The measure returns 4/10 = 40%
Please let me know if you have further questions.
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @rgonzalez_rpra,
Thanks for reaching out to the Microsoft fabric community forum.
@maruthisp @Deku Thanks for your Prompt response
@rgonzalez_rpra
I’ve implemented the calculation logic you described(With SampleData), and it works perfectly for the use case!
The measure accurately counts cases where both Case Age = 0 and Reopened = 0, and divides that by the total cases handled. When used in a report with agent-level filtering, it correctly shows the percentage of same-day closed, not reopened cases per agent.
Uploaded the PBIX file here .for ref
If this post helped resolve your issue, please consider giving it Kudos and marking it as the Accepted Solution. This not only acknowledges the support provided but also helps other community members find relevant solutions more easily.
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
LakshmiNarayana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @rgonzalez_rpra ,
I guess, you need to create the measures as per my understanding:
1. Total Cases Handled - DISTINCTCOUNT(Cases[CaseID])
2. Cases Closed Same Day, Not reopened -
ClosedSameDayNotReopened =
CALCULATE(
COUNTROWS(Cases),
Cases[CaseAge] = 0,
Cases[Reopened] = 0
)
3. % calculation
Pct_ClosedSameDayNotReopened =
DIVIDE(
[ClosedSameDayNotReopened],
[TotalCases],
0
)
Example:
I handled 10 cases
4 of them have caseage = 0 and reopened = 0
The measure returns 4/10 = 40%
Please let me know if you have further questions.
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Var bothZero =
Calculate(
Countrows( table ),
Table[Case Age] = 0,
Table[Reopened] = 0
)
Return
Divide(
AllZero,
Countrows( table )
)
Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources
Join our Fabric User Panel
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Power BI Monthly Update - June 2025
Check out the June 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
05-20-2025 08:00 PM | |||
04-22-2025 07:14 AM | |||
05-25-2025 11:55 AM | |||
Monday | |||
05-21-2025 01:48 PM |
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |