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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Sunilkulkarni
Frequent Visitor

Dax to calculate presence in school

Hi

 

I have Attendance table which has dates and Attendance presence data, and in presence coloumn it is represented as 1 if presence and 0 if it is absent.

 

Need to calculate the % of Presence , I need to calculate % of Students presence only for students who have attended school 4 days and above for a week, This count of students will be divided by total no. of students. Kindly help with DAX

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sunilkulkarni 

Based on your description, I created my own form to fulfill your needs.

vyilongmsft_0-1707372568092.png

A DAX can be written to figure out the percentage of attenders.

Percentage_Presence = 
VAR _A = CALCULATE(
             COUNTROWS('Attendance'),
             'Attendance'[Presence] = 1,
             'Attendance'[Days_Attended] >=4
)
VAR _AA = COUNTROWS('Attendance')
RETURN
IF(_A=1,DIVIDE(_A,_AA,0)* 100 & "%",BLANK()) 

vyilongmsft_1-1707373253625.png

This is just my guess as to what you are describing, if you can provide me with more information I can give you an answer.

How to Get Your Question Answered Quickly 

 

 

Best Regards

Yilong Zhou

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Sunilkulkarni 

Based on your description, I created my own form to fulfill your needs.

vyilongmsft_0-1707372568092.png

A DAX can be written to figure out the percentage of attenders.

Percentage_Presence = 
VAR _A = CALCULATE(
             COUNTROWS('Attendance'),
             'Attendance'[Presence] = 1,
             'Attendance'[Days_Attended] >=4
)
VAR _AA = COUNTROWS('Attendance')
RETURN
IF(_A=1,DIVIDE(_A,_AA,0)* 100 & "%",BLANK()) 

vyilongmsft_1-1707373253625.png

This is just my guess as to what you are describing, if you can provide me with more information I can give you an answer.

How to Get Your Question Answered Quickly 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Daniel29195
Super User
Super User

Hello @Sunilkulkarni 

i have posted the solution on your original post . 

 

https://community.fabric.microsoft.com/t5/Desktop/DAX-to-calculate-Number-of-days-presence-in-a-week...

 

 

 

let me know if it works for you . And sorry for the late response. 

 

 

vanessafvg
Super User
Super User

please provide sample data in order to give enable giving a solution, if you can't share your data, then provide some dummy data

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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