Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
hi everyone,
I would like someone to help me please as I have a list of MRN and each MRN has many case numbers.
the task is to calculate how many MRN have more than 5 case numbers:
MRN | Case Number |
NCP1234 | CS1641870 |
NCP1234 | CS1641870 |
NCP1234 | CS1641870 |
NCP1234 | CS1641870 |
NCP1234 | CS1641870 |
NCP 3692 | CS1630783 |
NCP 3692 | CS1630783 |
I tried with the below code:
but this message appears :
"can't convert values of type text"
Solved! Go to Solution.
@thesword1404 , Hope this will give you desired output. Use it directly on card visual:-
_count_case =
VAR _Table =
SUMMARIZE (
'optimize',
'optimize'[MRN],
'optimize'[Case Number],
"Count", COUNTROWS ( 'optimize' )
)
RETURN
COUNTROWS ( FILTER ( _Table, [Count] >= 5 ) )
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
thanks for your effort but this is not what I am looking for, I need a measure to compute the count of MRNs that have 5 or more case numbers without using filters from outside
@thesword1404 , Hope this will give you desired output. Use it directly on card visual:-
_count_case =
VAR _Table =
SUMMARIZE (
'optimize',
'optimize'[MRN],
'optimize'[Case Number],
"Count", COUNTROWS ( 'optimize' )
)
RETURN
COUNTROWS ( FILTER ( _Table, [Count] >= 5 ) )
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
thank you soooo much dear for your kind help.
I actulay modfied the code a littele bit but the you gave me what I needed exactly:
count of case numbers =
VAR casees = SUMMARIZECOLUMNS ( Table1[MRN],
"count", COUNTROWS ( Table1 ) )
RETURN
COUNTROWS ( FILTER ( casees, [count] > 5 ) )
Hi @thesword1404 ,
Create a measure like below:-
_count =
COUNTROWS (
FILTER ( 'Table (3)', 'Table (3)'[MRN] = MAX ( 'Table (3)'[MRN] ) )
)
and use it on visual as filter like below:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
thanks for your reply but what I need acutely is a card visual that shows the number of counts for each MRN that have more than 5 case numbers
@thesword1404 In that case you need multicard visual and add measure like below:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |