Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I am trying to figure out how to get a count on the number of products that passed thier test on the first run. So I want a count of the rows where the first value in the status column is "Passed". Example selection below
| DATE | USER | SN | Pass/Fail | |||||
| 4/5/2022 8:15 | 53209 | 22032722 | 28 | Passed | ||||
| 4/5/2022 8:16 | 53209 | 22032679 | Failed | |||||
| 4/5/2022 8:17 | 53209 | 22032679 | Failed | |||||
| 4/5/2022 8:17 | 53209 | 22032679 | 27 | Passed | ||||
| 4/5/2022 8:19 | 53209 | 22032676 | 28 | Passed | ||||
| 4/5/2022 8:20 | 53209 | 22032707 | 27 | Passed | ||||
| 4/5/2022 8:23 | 53209 | 22032955 | Failed | |||||
| 4/5/2022 8:23 | 53209 | 22032955 | 28 | Passed | ||||
| 4/5/2022 8:24 | 53209 | 22032945 | Failed | |||||
| 4/5/2022 8:24 | 53209 | 22032945 | 28 | Passed | ||||
| 4/5/2022 8:26 | 53209 | 22032866 | Failed | |||||
| 4/5/2022 8:26 | 53209 | 22032866 | 28 | Passed | ||||
| 4/5/2022 8:27 | 53209 | 22032704 | 28 | Passed | ||||
| 4/5/2022 8:39 | 53209 | None | Not Tested | |||||
| 4/5/2022 8:40 | 53209 | None | Not Tested | |||||
| 4/5/2022 8:40 | 53209 | 22044387 | 27 | Failed | ||||
| 4/5/2022 8:41 | 53209 | 22044387 | 27 | Passed | ||||
| 4/5/2022 8:42 | 53209 | 22044388 | 28 | Passed | ||||
| 4/5/2022 8:43 | 53209 | 22044389 | Failed |
Any help is greatly appriciated.
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a column first.
Column 2 _passed =
CALCULATE (
MIN ( 'Table'[Pass/Fail] ),
FILTER (
'Table',
'Table'[DATE] = EARLIER ( 'Table'[DATE] )
&& 'Table'[SN] = EARLIER ( 'Table'[SN] )
)
)
Then create a measure.
Measure_count =
VAR _mindate =
CALCULATE (
MIN ( 'Table'[DATE] ),
FILTER (
ALL ( 'Table' ),
'Table'[USER] = SELECTEDVALUE ( 'Table'[USER] )
&& 'Table'[SN] = SELECTEDVALUE ( 'Table'[SN] )
)
)
RETURN
CALCULATE (
COUNT ( 'Table'[Column 2 _passed] ),
FILTER (
ALL ( 'Table' ),
'Table'[Column 2 _passed] = "Passed"
&& 'Table'[DATE] = _mindate
)
)
If I have misunderstood your meaning, please provide your desired output with a screenshot.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a column first.
Column 2 _passed =
CALCULATE (
MIN ( 'Table'[Pass/Fail] ),
FILTER (
'Table',
'Table'[DATE] = EARLIER ( 'Table'[DATE] )
&& 'Table'[SN] = EARLIER ( 'Table'[SN] )
)
)
Then create a measure.
Measure_count =
VAR _mindate =
CALCULATE (
MIN ( 'Table'[DATE] ),
FILTER (
ALL ( 'Table' ),
'Table'[USER] = SELECTEDVALUE ( 'Table'[USER] )
&& 'Table'[SN] = SELECTEDVALUE ( 'Table'[SN] )
)
)
RETURN
CALCULATE (
COUNT ( 'Table'[Column 2 _passed] ),
FILTER (
ALL ( 'Table' ),
'Table'[Column 2 _passed] = "Passed"
&& 'Table'[DATE] = _mindate
)
)
If I have misunderstood your meaning, please provide your desired output with a screenshot.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 40 | |
| 36 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 74 | |
| 72 | |
| 38 | |
| 35 | |
| 26 |