Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello, I have column of 3 letter defect codes in a QC data tracker table. These values are combined when they are entered into the PowerApp I use to records the data.
I am now trying to create a pareto chart pf the top 3-letter defect codes in a given period. I am stuck on the measure to count if the column contains a specific defect code.
There are over 20 different defect codes I will have to write measures to count.
I have tried several of the DAX responses on previous posts with no avail. Examples below:
APP Count = COUNTROWS (
FILTER ( HILLIARDQCDATA, CONTAINSSTRING ( HILLIARDQCDATA[Defect Code(s)], "APP," ) )
)
Countif:=CALCULATE(
COUNTROWS(Table),
SEARCH("a",Table[names],,0))
Data:
Table of Defect Codes:
Column I need to count is Defect Code(s):
Any help or tips are very much appreciated.
Thank you in advance!
Solved! Go to Solution.
Hi @JWPowder ,
Based on your question, you can follow the measure below.
Sample data:
Add a new measure:
SDS COUNT =
VAR _ture_or_false =
CONTAINSSTRING ( SELECTEDVALUE ( 'Table (2)'[Defect Code(s)] ), "SDS" )
VAR _text_app =
IF ( _ture_or_false = TRUE (), 1, 0 )
RETURN
CALCULATE ( COUNTROWS ( 'Table (2)' ), FILTER ( 'Table (2)', _text_app = 1 ) )
RESULT = SUMX('Table (2)','Table (2)'[SDS COUNT])
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JWPowder ,
Based on your question, you can follow the measure below.
Sample data:
Add a new measure:
SDS COUNT =
VAR _ture_or_false =
CONTAINSSTRING ( SELECTEDVALUE ( 'Table (2)'[Defect Code(s)] ), "SDS" )
VAR _text_app =
IF ( _ture_or_false = TRUE (), 1, 0 )
RETURN
CALCULATE ( COUNTROWS ( 'Table (2)' ), FILTER ( 'Table (2)', _text_app = 1 ) )
RESULT = SUMX('Table (2)','Table (2)'[SDS COUNT])
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.