Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm having trouble creating a measure that will show total unique members by Bins based on the sum of thier individual fact rows.
The table on the right shows is what I'm trying to create with DAX as opposed to single purpose reporting table.
The fact table has the number of prescription drug refills by member.
If member 123 has 3 refills of a drug, he or she will fall into the 3 bin. I only count member 123 once.
Any help greatly appreciated.
Jason
Solved! Go to Solution.
In your scenario, I think you can add a calculated column for "refill times" in your fact table.
Refill Times = CALCULATE(COUNTROWS(),ALLEXCEPT('Fact','Fact'[Drug],'Fact'[Member]))
Then create a measure to distinct count members group on Drug and Refill Times.
Distinct Members = CALCULATE(DISTINCTCOUNT('Fact'[Member]),ALLEXCEPT('Fact','Fact'[Drug],'Fact'[Refill Times]))
Regards,
In your scenario, I think you can add a calculated column for "refill times" in your fact table.
Refill Times = CALCULATE(COUNTROWS(),ALLEXCEPT('Fact','Fact'[Drug],'Fact'[Member]))
Then create a measure to distinct count members group on Drug and Refill Times.
Distinct Members = CALCULATE(DISTINCTCOUNT('Fact'[Member]),ALLEXCEPT('Fact','Fact'[Drug],'Fact'[Refill Times]))
Regards,
Simon,
I've implemented this and it works great. My only change was to add formatting to the Refill column to place any count 5 or greater into a 5+ bucket.
Thanks again for the help!
Thanks, I'll take a crack using your suggestions.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |