Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I am relatively new to PBi but have done a basic skills course and half way through the intermediate one. I have created a report for school attendance and am trying to add a column to my Pupils data table which brings in the prior year attendance for each pupil. I have used a Calculate formula (see below), which brings in the % attendance from my Measures table, and links to the Dates table. The formula seems to be OK, as no error message has been generated, but no data is showing in the table. Any ideas on what I am doing wrong? Thank you.
Here are a few things to check:
Relationships: Ensure that there is a proper relationship between the tables involved (Pupils, Attendance Measures, and Attendance Dates). The relationship should be based on the date fields so that the calculation can flow correctly.
Date Filtering: Verify that your date filtering works as intended. The PREVIOUSYEAR function requires a date column. Ensure that your [Date] column in the Attendance Dates table contains appropriate date values.
Date Format: Make sure that the date format in your DAX function matches the format stored in your [Date] column. If your dates are stored as Date type, you should use a date format like DATE(2023, 8, 31) instead of "31/08/2023".
Here's the revised version of your DAX formula:
% Attend Last Year =
CALCULATE(
'Attendance Measures'[% Attend for period],
PREVIOUSYEAR('Attendance Dates'[Date])
)
If your PREVIOUSYEAR function is correctly set up, this formula should calculate the attendance percentage for each pupil for the previous year based on the dates in your Attendance Dates table.
If you're still encountering issues, it might be helpful to break down your problem further and check the individual components to identify where the problem lies. You can try testing each part of your formula separately in a DAX expression window to see if they return the expected results.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
20 | |
18 | |
17 | |
16 |
User | Count |
---|---|
34 | |
21 | |
19 | |
18 | |
11 |