Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Help me for the DAX

Hi, Please help me find the DAX to measure the Number of class taken attendance and Number of class not taken attendance. I have attached the pain in this link https://www.dropbox.com/s/8jb1mkm8eev559y/My%20Data.pbix?dl=0 Thanks
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

We can try to use the following measures to meet your requirement:

 

class taken attendance = COUNTROWS(FILTER(SUMMARIZE('Class Master','Class Master'[Class ID],"Attendance",COUNTROWS('Attendance Master')>0),[Attendance]))

 

class do not taken attendance = 
COUNTROWS(FILTER(SUMMARIZE('Class Master','Class Master'[Class ID],"Attendance",COUNTROWS('Attendance Master')>0),not [Attendance]))

 

12.jpg

 


If it doesn't meet your requirement, Could you please show the exact expected result based on the tables that you have shared?


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
nandukrishnavs
Super User
Super User

@Anonymous 

absent = CALCULATE(COUNT('Attendance Master'[Child ID]),'Attendance Master'[Child Is Present?]=FALSE())
Present = CALCULATE(COUNT('Attendance Master'[Child ID]),'Attendance Master'[Child Is Present?]=TRUE())



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂 


Regards,
Nandu Krishna

Anonymous
Not applicable

Thank you for help bro. But, I want to know how many class taken attendance and how many class do not taken attendance in a month

Hi @Anonymous ,

 

We can try to use the following measures to meet your requirement:

 

class taken attendance = COUNTROWS(FILTER(SUMMARIZE('Class Master','Class Master'[Class ID],"Attendance",COUNTROWS('Attendance Master')>0),[Attendance]))

 

class do not taken attendance = 
COUNTROWS(FILTER(SUMMARIZE('Class Master','Class Master'[Class ID],"Attendance",COUNTROWS('Attendance Master')>0),not [Attendance]))

 

12.jpg

 


If it doesn't meet your requirement, Could you please show the exact expected result based on the tables that you have shared?


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous  Use merge option in Edit Query.

 

Class ID in Attendance Master and Class ID in Class table. (All from the class table and matching from the attendance table. )

Then count the blanks in the new class id column. That is the count of classes has not taken attendance. 


Regards,
Nandu Krishna

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.