Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am having trouble coming up with a measure to count the number of students who have attended a set of subjects in the below data table. For example, if I wanted to count the number of students who have attended all four subjects, I would want the measure to output only Charles, as he is the only student has met this criteria. I came up with the following:
Subject | Present | Student |
Physics | Yes | Charles |
Physics | Yes | Daryl |
Physics | Yes | John |
Physics | Yes | Jess |
Calculus | Yes | Daryl |
Calculus | Yes | Charles |
Calculus | Yes | Charles |
Calculus | Yes | Charles |
Calculus | Yes | Henry |
Calculus | Yes | Jess |
Calculus | Yes | Charles |
Calculus | Yes | Charles |
History | Yes | Lucas |
History | Yes | Charles |
History | Yes | Edgar |
History | Yes | Charles |
History | Yes | Charles |
History | Yes | Edgar |
History | Yes | Edgar |
History | Yes | Charles |
History | Yes | Tess |
Calculus | No | Charles |
History | No | Lucas |
History | No | Charles |
History | No | Edgar |
History | No | Charles |
History | No | Charles |
History | No | Edgar |
History | No | Edgar |
History | No | Charles |
History | No | Tess |
History | No | Edgar |
Writing | No | Daryl |
Writing | No | Edgar |
Writing | No | Tess |
Writing | No | Tess |
Writing | No | Edgar |
Writing | Yes | Tess |
Writing | Yes | Charles |
Writing | Yes | Edgar |
Writing | Yes | Edgar |
Solved! Go to Solution.
First you need group data at student level,
Try like
Total Student = sumx(filter(summarize(filter(table,present="Yes"), student, "_tSub",distinctcount(subject)),[_tSub]>=4),[_tSub])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
First you need group data at student level,
Try like
Total Student = sumx(filter(summarize(filter(table,present="Yes"), student, "_tSub",distinctcount(subject)),[_tSub]>=4),[_tSub])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
@amitchandak Hello! I think I have a very similar problem, but I can't seem to get your solution to work, i must be missing something very obvious. I have basically the same data model
Chain | Establishment | Category | Brand | SKU | Is the SKU present |
Chain1 | POS1 | Category1 | Brand1 | SKU | Yes |
Chain1 | POS1 | Category1 | Brand2 | SKU | Yes |
Chain1 | POS1 | Category2 | Brand1 | SKU | No |
Chain1 | POS1 | Category2 | Brand2 | SKU | Yes |
But I need is the % of POS that have at least one SKU present in each brand. If this was my complete dataset then, I would have 100% in Category 1 and 0% in category2. I tried the recommended way but doesn't show any results:
This is the Measure I'm using:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
61 | |
46 | |
45 |