Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rihab
Frequent Visitor

Calculate the number of rows that has an exact value for distinct ids

IMG_2308.jpeg

Hello, 

i am new in power bi world and I would like to create a measure that counts how many Rows had the value to investigate but for distinct Id , means if we have 3 rows with ´to investigate "value it should be counted as 1. Here is an example of data , the measure should show 3 as a result 

thank you in advance

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Rihab , you can try using below measure

DistinctCountToInvestigate =
CALCULATE(
DISTINCTCOUNT(YourTable[Id]),
YourTable[Value] = "to investigate"
)

 

Replace value as 3 and mention your table name it will work




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

7 REPLIES 7
bhanu_gautam
Super User
Super User

@Rihab , you can try using below measure

DistinctCountToInvestigate =
CALCULATE(
DISTINCTCOUNT(YourTable[Id]),
YourTable[Value] = "to investigate"
)

 

Replace value as 3 and mention your table name it will work




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






manvishah17
Responsive Resident
Responsive Resident

Hi @Rihab , 
In my sample data 'to Investigate' is 4 time so...
for only 'To investigate' , you can use this 
Screenshot 2024-05-06 174823.png

 the 3 rows of value "to investigate" for ID 1 should be counted as 1 , is there possible to do it without using filters , it should be in the measure , also in your first response you are counting on ID, by my goal to count the value "to investigate" 

 

manvishah17
Responsive Resident
Responsive Resident

Okay @Rihab ,
I got your point, you can count on values, but for choosing only one "to investigate", you need to choose it from filter whether it can  be a slicer , or visual level filter.

Count = 
 CALCULATE(
    DISTINCTCOUNT(Sheet2[value])
 )

Screenshot 2024-05-06 184512.png

jay_patel
Helper IV
Helper IV

Just add visual level filter for value = "To investigate". it will gives you distinct count for that only.

manvishah17
Responsive Resident
Responsive Resident

Hi @Rihab ,
In order to count distinct id you can use this measure ,

 

Count = 
DISTINCTCOUNT(Sheet2[id])

 

See I have created sample file and it shows following results ,
Screenshot 2024-05-06 170556.png

 

Screenshot 2024-05-06 170152.png

 

 If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

thank you for your quick response but I need only to calculate only when the value is "to investigate" and the KPI should show 3 not 4 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors