Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Team,
Have just started my PowerBi Journey, and have a Q.
I have 2 Columns. KeyValue and Status
KeyValue are Unique IDs
Status = Pending; Exception; Completed (see table below for details)
Question?
How can I calculate System Exception SUM(total) Keyvalues (execlude if they already in COMPLETE status)
| KeyValue | Status |
| ID- 111 | System Exception |
| ID- 111 | Business Exception |
| ID- 111 - Review | Completed |
| ID- 222 - Review | Completed |
| ID- 333 | Completed |
| ID-444 | System Exception |
| ID-555 | System Exception |
| ID-666 | Business Exception |
| Results (Pie Chart) | |
| Completed (with Review in KeyValue) = | 2 |
| System Exception = | 2 |
| Business Exception = | 1 |
| Total KeyValue = | 6 |
Solved! Go to Solution.
I'd suggest making a new column that only includes the elements that have the uniqueness you want. I'd suggest doing this in Power Query. Then just update the provided code to work how you need it.
Create 2 different measures. The first measure is your base measure which will do the sum/count etc. It might be something like:
Total Records = COUNTROWS('Your Table Name')(this will give you a record count, alternatively you could use DISTINCTCOUNT('Your Table Name'[KeyValue]) if you want uniques only
Next you'll write a measure that calls the base measure but excludes items you don't want:
Count excluding completed = CALCULATE(
[Total Records],
'Your Table Name'[Status] <> "Completed"
)
Hello @hsiddiq ,
it's true as @RossEdwards , but it could be written as one measure, no need for two measures
Count excluding completed = CALCULATE(
countrows('YourTableName'),
'Your Table Name'[Status] <> "Completed"
)
Proud to be a Super User! | |
Don't write it as one measure. If you do that you will get the wrong answers in certain aggregation situations.
@hsiddiq @Idrissshatila
I'd suggest making a new column that only includes the elements that have the uniqueness you want. I'd suggest doing this in Power Query. Then just update the provided code to work how you need it.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!