Forum Discussion
Filter and Replace values
- Anonymous2 years ago
Hi, SCallanan
I am glad to help you.
But I am not sure if I have understood your needs correctly.
Perhaps you could start by trying to create a calculated column that marks each Trip Inspection Id as having both "Administrative" and "Physical":HasBoth = VAR CurrentTripId = Inspections[Trip Inspection Id] RETURN IF ( CALCULATE ( COUNTROWS ( Inspections ), Inspections[Trip Inspection Id] = CurrentTripId, Inspections[Inspection Group] = "Administrative" ) > 0 && CALCULATE ( COUNTROWS ( Inspections ), Inspections[Trip Inspection Id] = CurrentTripId, Inspections[Inspection Group] = "Physical" ) > 0, 1, 0 )
Then create a Measure:TripInspectionIdCount = CALCULATE ( DISTINCTCOUNT ( Inspections[Trip Inspection Id] ), Inspections[HasBoth] = 1 ) + CALCULATE ( DISTINCTCOUNT ( Inspections[Trip Inspection Id] ), Inspections[HasBoth] = 0 )
Here is the final test result, hope it helps:If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
SCallanan I'm not sure what you need to do, you just need to distinctcount the trip ID?
If so, is as simple as this:
If not please explain better what you need
- SCallanan2 years agoFrequent Visitor
Hi Gabry
It is really part of a bigger problem /Count-of-ID-with-filters-based-on-a-different-column-Values
maybe it helps to understand the context if you have a look at that.
Thanks so much, I'm trying to get this right for ages.