cancel
Showing results for
Did you mean:

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

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
Community Support

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

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()) ``````

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.

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.

3 REPLIES 3
Community Support

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

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()) ``````

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.

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.

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.

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!

Announcements

#### New forum boards available in Real-Time Intelligence.

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

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors