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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
v-yilong-msft
Community Support
Community Support

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
v-yilong-msft
Community Support
Community Support

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.