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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors