Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I need to count the number of times that both a column in one table has a certain value and a column in another table has a certain value.
I have a Filter for the 'epro trauma data' table:
I have a filter for the 'cad inmain' table:
CALCULATE(COUNTROWS('cad inmain'), FILTER('cad inmain','cad inmain'[secsar2tr]<900))
What I need is to count the rows in 'epro trauma data' when both conditions exist.
'epro trauma data' is linked to 'epro incident data' by a one-to-one relationship with filtering in both directions.
'epro incident data' is linked to 'cad inmain' by a many-to-one relationship with filtering in both directions.
Any help would be appreciated.
Once this is all done - I need to be able to use slicers for date and a few other fields in "'epro incident data'
Solved! Go to Solution.
Hi @DarrelDonatto ,
According to your description, here's my solution.
Count is a measure in epro trauma data table.
Count =
CALCULATE (
COUNTROWS ( 'epro trauma data' ),
FILTER (
ALL ( 'epro trauma data' ),
'epro trauma data'[TIME_OF_TRAUMA_ALERT] <> BLANK ()
),
FILTER ( ALL ( 'cad inmain' ), 'cad inmain'[secsar2tr] < 900 )
)
Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DarrelDonatto ,
According to your description, here's my solution.
Count is a measure in epro trauma data table.
Count =
CALCULATE (
COUNTROWS ( 'epro trauma data' ),
FILTER (
ALL ( 'epro trauma data' ),
'epro trauma data'[TIME_OF_TRAUMA_ALERT] <> BLANK ()
),
FILTER ( ALL ( 'cad inmain' ), 'cad inmain'[secsar2tr] < 900 )
)
Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much. Works perfectly..
You can combine these filters
CALCULATE(COUNTROWS('epro trauma data'), 'epro trauma data'[TIME_OF_TRAUMA_ALERT]<>"",'cad inmain'[secsar2tr]<900)
However your data model may not support this query.
User | Count |
---|---|
83 | |
74 | |
73 | |
47 | |
36 |
User | Count |
---|---|
113 | |
56 | |
52 | |
42 | |
42 |