Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I am a new user of Power BI. I have a table in which one primary column has a duplicate value.
I have counted this column's distinct values. But how do I count other column values according to this column's unique values?
I have used below measuer but its not working.
MRN is primiray column.
Hi,
Drag Gender to the Table visual and write this measure
Measure = distinctcount(Demographic[MRN])
Hope this helps.
Hi @naseem_1973 ,
Do you mean counting by [MRN] and [Gender] grouping or do you mean counting the same number in the whole [Gender] based on the [Gender] of each [MRN].
The former:
Create measure.
Measure1 =
COUNTX(
FILTER(ALL(Demographic),'Demographic'[MRN]=MAX('Demographic'[MRN])&&'Demographic'[Gender]=MAX('Demographic'[Gender])),[Gender])
Result:
The latter:
Create measure.
Measure2 =
var _select=SELECTCOLUMNS(FILTER(ALL(Demographic),'Demographic'[MRN]=MAX('Demographic'[MRN])),"column",[Gender])
return
COUNTX(
FILTER(ALL(Demographic),
'Demographic'[Gender] in _select&&'Demographic'[Gender]=MAX('Demographic'[Gender])),[Gender])
Result:
If that result does not meet your expectations, you can express the expected result in the form of a picture and we can help you better.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Sir,
I think you are not understand my query.
Mrn Gender
123- Male
123 Male
211- Female
211-Femal
Keep in mind this scenario, I want to count 1 male and 1 female because both registrations same.
User | Count |
---|---|
88 | |
74 | |
69 | |
65 | |
58 |
User | Count |
---|---|
106 | |
97 | |
76 | |
63 | |
60 |