User Profile
stuartcorns
New Member
Joined 3 years ago
User Widgets
Contributions
Using a function returns blank when using another function value
Hi, I was wondering if anyone could help - new to the community. I have some DAX code that should return some student attendance for the previous week. However, I currently have to hard code the previous fiscal week number, when I place the value from the Calendar Dates table (Calculates the previous fiscal week from the current). This my code Previous Week Attendance Measure = var _measure = DIVIDE( CALCULATE( COUNT('AT_Session_Marks'[Session Mark]), FILTER(AT_Session_Marks, 'AT_Session_Marks'[Absent] = TRUE), FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 1) ), CALCULATE( COUNT('AT_Session_Marks'[Session Mark]), FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 1) ), 0) return IF(ISBLANK(_measure), 0, _measure) The above returns the correct amount. Previous Week Attendance Measure = var _measure = DIVIDE( CALCULATE( COUNT('AT_Session_Marks'[Session Mark]), FILTER(AT_Session_Marks, 'AT_Session_Marks'[Absent] = TRUE), FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 'Calendar Functions'[Previous Fiscal Week]) ), CALCULATE( COUNT('AT_Session_Marks'[Session Mark]), FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 'Calendar Functions'[Previous Fiscal Week]) ), 0) return IF(ISBLANK(_measure), 0, _measure) Whereas the above returns 0 despite the 'Calendar Functions'[Previous Fiscal Week] outputting the correct value. Appreciate some guidance. TIASolved615Views0likes1Comment
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.