Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi community folks,
I am building a KPI dashboard, but kind of struggling to write the correct measure. Can you please kindly help? Thanks a lot!
My dataset is like this, I want to calculate certain opportunity # based on the KPI criteria. The criteria is as follow:
Opportunity Name | Product Name | Stage | KPI Product Group |
Opportunity X | Product A1 | Pending | A |
Opportunity X | Product B1 | Pending | B |
Opportunity Y | Product A1 | Pending | A |
Opportunity Y | Product A2 | Pending | A |
Opportunity Y | Product B1 | Pending | B |
Opportunity Z | Product B1 | Won | B |
Opportunity Z | Product B2 | Won | B |
Opportunity Z | Product B3 | Won | B |
Opportunity Z | Product B4 | Won | B |
Hi @ihungko
You can simply write DISTINCTCOUNT().
If you want to take count against only opportunity name.
If this not what you are looking for then let me know the expected output like what other columns you are expecting and count value against it.
Hi Uzi, thanks for your reply.
DISTINCTCOUNT was my first option, however, there is a sistuation when kpi product group has more than 2, for example like the table below:
The desired outcome would be
Opportunity Name | Credit |
Opportunity X | 1 |
Opportunity Y | 1 |
Opportunity Z | 1 |
Opportunity AA | 2 |
TOTAL | 5 |
But if I use DISTINCTCOUNT on KPI Product Group, it will be 3 in total,
Opportunity Name | Product Name | Stage | KPI Product Group |
Opportunity X | Product A | Pending | A |
Opportunity Y | Product A | Pending | A |
Opportunity Z | Product A | Pending | A |
Opportunity AA | Product B | Pending | B |
Opportunity AA | Product C | Pending | C |
I created a column concatenating Opportunity Name and KPI Product Group, and then use Distinctcount. It worked!
But I am still wondering if there's more efficient / lighter way to do so.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
42 | |
30 | |
27 | |
27 |