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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
brysonb12
Frequent Visitor

Count Distinct Items

Trying to do a Count If Measure but dont want to count if it contains other criteria

 

I have Column A Listed as "WO#" and Column B listed at "WO Type". Under column WO Type I have multiple criteria (T&M or LS)

What I am wanting to do is create a measure that Counts the number of times the WO# appears in T&M but noes not appear in both

 

Example being 

 

WO#WO TYPE
1111T&M
1111LS
2222T&M
3333T&M
4444LS

 

So my number that would show in my card would be T&M - 2

2 REPLIES 2
MahyarTF
Memorable Member
Memorable Member

Hi,

Not sure, if I am right ?

1- I create duplicated table in power query :

MahyarTF_0-1660177652925.png

2- Then Group the WO# column :

MahyarTF_1-1660177684543.png

3- Apply to the power bi :

MahyarTF_2-1660177736660.png

4- Create the below measure in main table :

Wo Typ Cnt = count(Sheet85[WO TYPE])
5- then develop the below visual :
MahyarTF_3-1660177944815.png

 

* in desired visual, put the count = 1 (use 'Count' column from the duplicated table)

 

****** Appreciate to Kudos *******

Mahyartf

I tried that and It did not work. The issue I am running into is this is a data set of a month. So the WO# can show up multiple times a day with multiple people. 

 

I need it to be able to count the number of times that T&M shows up, but I want **bleep** to EXCLUDE the T&M job number if it has LS wiht it. 

 

IE - In the example below T&M WO# Count = 2 (because WO#33333 and 44444 ONLY have T&M time)

 

 

Timesheet DateLast NameWO#Class
07/01/2022John11111T&M
07/01/2022John11111LS
07/01/2022Bill11111LS
7/8/2022Bill22222T&M
7/8/2022Lance22222LS
7/15/2022John333333T&M
7/15/2022John333333T&M
7/18/2022Bill444444T&M
7/18/2022Lance444444T&M
7/18/2022Bill444444T&M
7/18/2022Lance444444T&M

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.