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.
I would like to know what the count of Work Orders is that do not contain "Parts" (Line Type). So exclude any work order that at least contain 1 line with Line Type "Parts".
See example of the table below.
Work Order # Line Type
WO-00673116 | Labor |
WO-00673116 | Parts |
WO-00673116 | Expenses |
WO-00672716 | Labor |
WO-00672701 | Labor |
WO-00672404 | Labor |
WO-00672404 | Parts |
WO-00672404 | Expenses |
WO-00672302 | Labor |
WO-00672089 | Labor |
WO-00671319 | Labor |
WO-00671256 | Labor |
WO-00670986 | Labor |
WO-00670986 | Parts |
WO-00670986 | Expenses |
WO-00670463 | Labor |
WO-00670462 | Labor |
Solved! Go to Solution.
Hi @PijushRoy , many thanks for your very quick and effective replies.
Hi @KvO88 ,
Please try to create measure with below dax formual:
MEASURE =
VAR tmp =
SUMMARIZE (
'Table',
'Table'[Work Order # ],
"Concate Line Type", CONCATENATEX ( 'Table', [Line Type], "," )
)
VAR tmp1 =
FILTER ( tmp, NOT ( CONTAINSSTRING ( [Concate Line Type], "Parts" ) ) )
RETURN
COUNTROWS ( tmp1 )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PijushRoy , many thanks for your very quick and effective replies.
Hi @KvO88 ,
Please try to create measure with below dax formual:
MEASURE =
VAR tmp =
SUMMARIZE (
'Table',
'Table'[Work Order # ],
"Concate Line Type", CONCATENATEX ( 'Table', [Line Type], "," )
)
VAR tmp1 =
FILTER ( tmp, NOT ( CONTAINSSTRING ( [Concate Line Type], "Parts" ) ) )
RETURN
COUNTROWS ( tmp1 )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @KvO88
Please use the below DAX in measure.
Measure 2 = CALCULATE(
DISTINCTCOUNT('YourTable'[Work Order #]),
'YourTable'[Line Type] <> "Parts")
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
@PijushRoy Thanks for thinking along. However, this only excludes the rows that do not have the line type "Parts". I only want to see the count of Work Orders that does not contain "Parts" at all. In the screenshot I only want to count WO-00591022, WO-00591040 and WO-00591219. I do not want include WO-00591263 and WO-00591438 because do do not only contain Labor.
hi @KvO88
Create a New Measure:
Write the DAX Formula:
Work Orders Without Parts = CALCULATE( COUNTROWS(YourTableName), NOT(YourTableName[Line Type] = "Parts") )Replace 'YourTableName' with the actual name of your table.
Explanation:
Display the Result:
Hi @AnalyticsWizard Thanks for thinking along. This measure does not calculate distinct. Since each WO number can have multiple rows, it will not show the number of (distinct) WO's that do not contain Parts. See also my answer to PijushRoy.
Hi @KvO88
Please try below DAX in measure
Measure 2 = CALCULATE(
DISTINCTCOUNT('Table (2)'[Work Order #]),
'Table (2)'[Line Type] <> "Parts")
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
104 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |