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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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