Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all - I'm trying to get a percentage of overdue registrations per category. A data sample is below. The registrations should be counted, not summed.
Category | Status | Registration |
Apple | Not Due | 4600 |
Orange | Not Due | 4218 |
Pear | Overdue | 4696 |
Strawberry | Overdue | 4215 |
Orange | Overdue | 4050 |
Pear | Not Due | 4491 |
Apple | Overdue | 3291 |
Strawberry | Not Due | 2026 |
Strawberry | Not Due | 2365 |
Apple | Not Due | 2943 |
Strawberry | Overdue | 2247 |
Pear | Not Due | 4143 |
Orange | Overdue | 2353 |
Orange | Not Due | 2010 |
Pear | Not Due | 3502 |
If I manually perform the calcuation in Excel, it looks like this:
Status | ||||
Category | Not Due | Overdue | TOTAL | % Overdue |
Apple | 2 | 1 | 3 | 33% |
Orange | 2 | 2 | 4 | 50% |
Pear | 3 | 1 | 4 | 25% |
Strawberry | 2 | 2 | 4 | 50% |
The answer I'm looking for is highlighted red above. I tried, couldn't figure it out LOL. Any help is appreciated, many thanks.
Solved! Go to Solution.
hi @elle-queue ,
plot a measure like:
%Overdue =
VAR _overdue =
COUNTROWS(
FILTER(
data,
data[status]="Overdue"
)
)
VAR _total = COUNTROWS(data)
RETURN DIVIDE(_overdue, _total)
it worked like:
CountOverdue =
CALCULATE(
COUNT('YourTable'[Registration]),
'YourTable'[Status] = "Overdue"
)
TotalRegistrations =
CALCULATE(
COUNT('YourTable'[Registration])
)
PercentageOverdue =
DIVIDE([CountOverdue], [TotalRegistrations], 0) * 100
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
hi @elle-queue ,
plot a measure like:
%Overdue =
VAR _overdue =
COUNTROWS(
FILTER(
data,
data[status]="Overdue"
)
)
VAR _total = COUNTROWS(data)
RETURN DIVIDE(_overdue, _total)
it worked like:
@elle-queue
You can try the following measure:
Let me know if that works. Kudos!
Thank you @HamedM1125 . This isn't exactly what I was wanting, but I can see how it could be useful for something else i'm working on, so thank you!
User | Count |
---|---|
82 | |
78 | |
67 | |
46 | |
45 |
User | Count |
---|---|
105 | |
44 | |
39 | |
39 | |
39 |