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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dodonald
Helper I
Helper I

Distinct Count of ID # based on filters in multiple columns

I am looking to calculate the "Right First Time" from below data.  I'm sure this is so simple but for some reason it keeps escaping me.

I want to count the unique # of IDs that do not have any instances of "rework" across tasks X, Y, and Z (excluding Q) and Role A, B, and C (excluding M). In this case, my count of Right First Time is 3 because ID # 789 does not have any value of "Rework", 987 only has rework from Task Q, and 654 only has rework by Role M.

 

I have measures already set up to count the total number of rework votes with the exclusions above, but for some reason I cant figure out how to get the unique count of the ID #s where the total number of rework votes = 0.

 

ID #DispositionRoleTask Name
123ReworkAX
123ProceedAX
123ProceedBY
123ReworkCZ
123ProceedCZ
456ProceedAX
456ProceedBY
456ReworkCZ
456ProceedCZ
789ProceedAW
789ProceedAQ
789ProceedBY
789ProceedCZ
987ProceedAW
987ReworkAQ
987ProceedAQ
987ProceedCZ
654ReworkMW
654ProceedBY
654ProceedCZ

 

Appreciate the help!!

9 REPLIES 9
ThxAlot
Super User
Super User

UnicTask.pbix

 

ThxAlot_0-1690012862572.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



rubayatyasmin
Super User
Super User

Hi, @dodonald 

 

To calculate the "Right First Time" count based on the given data, you'll need to follow these steps:

  1. Exclude the rows where Task Name is "Q" and Role is "M."
  2. Group the remaining data by ID #.
  3. For each group (ID #), check if any "Rework" value exists in the Disposition column for tasks X, Y, and Z.
  4. Count the unique ID #s where the total number of "Rework" votes is zero.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


How do I do #2? I dont want to transform the whole table b/c I have at least 25 measures and several visualizations dependent on how the entire table is currently structured.

  1. Open Power Query Editor:

    • With the data loaded into Power BI, navigate to the "Home" tab, and click on "Edit Queries." This will open the Power Query Editor.
  2. Filter Rows:

    • In the Power Query Editor, select the "Task Name" column header.
    • Click on the "Filter Rows" button in the "Home" tab.
    • In the filter dialog, uncheck the box for "Q" in the list of Task Names, and click "OK" to apply the filter.
  3. Add Another Filter:

    • Now, go back to the Power Query Editor and select the "Role" column header.
    • Click on the "Filter Rows" button again.
    • In the filter dialog, uncheck the box for "M" in the list of Roles, and click "OK" to apply the filter.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


I dont want to do this at the query level. This query is HUGE (much more than the data above) and I have several other measures and visualizations already in place.

Idrissshatila
Super User
Super User

Hello @dodonald ,

 

check this solution https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-rows-based-off-one-co...

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




I guess I'm not sure how to use "Filter". Can you possibly walk me through how this linked solution relates to my data?

Sorry I'm being dense. I've been working with 2 big data sets all week and - as it's now Friday afternoon - my brain is mush and my eyes are swimming. 😵

in PQ just click on the dropdown of the column name then select the value you want to keep and uncheck all the other values. this how filtering is done in PQ. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Your responses are not helpful. You continue to not read my replies. I am looking for a MEASURE not a filter within PQ. I know how to filter a column with a dropdown. I am looking for help with the Filter DAX.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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