User Profile
yannkonin
Frequent Visitor
Joined 2 years ago
User Widgets
Contributions
Re: Dax measure : Counting Rows for the Next Day - Help Needed!
Thank you very much, based on your response here is the solution i found Effectif Nuit = -- This DAX measure, which we will call "TotalNightDrivers", is used to calculate the number of separate drivers working "Night-evening" and "Night-morning" on the selected dates. VAR SelectedDates = VALUES('Calendar'[Date]) -- This variable creates a table of all dates selected from the 'Calendar' table. VAR ConducteursNuit = FILTER ( ALLSELECTED('data_chargeuses'), -- Applies filter to all selected rows (in case of global filter) of 'data_chargeuses'. (data_chargeuses[Shift] = "Nuit-soir" || data_chargeuses[Shift] = "Nuit-matin") && data_chargeuses[AdjustedDate] IN SelectedDates ) RETURN COUNTROWS ( SUMMARIZE ( ConducteursNuit, -- Use the ConducteursNuit table directly after applying the filters data_chargeuses[Nom Conducteur] ) ) here is the code for ajustedDate AdjustedDate = -- This calculated column, which we will call "AdjustedDate," is used to adjust the date based on the shift. -- If the shift is "Night-morning," the date is shifted one day backward. -- This accounts for drivers working overnight into the morning. IF ( data_chargeuses[Shift] = "Nuit-matin", data_chargeuses[Date] - 1, data_chargeuses[Date] )568Views0likes0CommentsDax measure : Counting Rows for the Next Day - Help Needed!
I'm having trouble counting rows for the next day using my DAX code. Can someone please help me understand why the "NuitMatinCount" isn't returning any results? I'd appreciate any insights into why the "NuitMatinCount" variable isn't providing the expected results. Thanks in advance! Here's my DAX code: Effectif Nuit = VAR CurrentDate = MAX(data_chargeuses[Date]) VAR Next = (CurrentDate + 1) VAR NuitSoirCount = CALCULATE( DISTINCTCOUNT(data_chargeuses[Nom Conducteur]), data_chargeuses[Shift] = "Nuit-Soir", data_chargeuses[Date] = CurrentDate ) VAR NuitMatinCount = CALCULATE( DISTINCTCOUNT(data_chargeuses[Nom Conducteur]), data_chargeuses[Shift] = "Nuit-Matin", data_chargeuses[Date] = Next ) RETURN NuitSoirCount + NuitMatinCount358Views0likes1CommentDax measure : Counting Rows for the Next Day - Help Needed!
I'm having trouble counting rows for the next day using my DAX code. Can someone please help me understand why the "NuitMatinCount" isn't returning any results? I'd appreciate any insights into why the "NuitMatinCount" variable isn't providing the expected results. Thanks in advance! Here's my DAX code: Effectif Nuit = VAR CurrentDate = MAX(data_chargeuses[Date]) VAR Next = (CurrentDate + 1) VAR NuitSoirCount = CALCULATE( DISTINCTCOUNT(data_chargeuses[Nom Conducteur]), data_chargeuses[Shift] = "Nuit-Soir", data_chargeuses[Date] = CurrentDate ) VAR NuitMatinCount = CALCULATE( DISTINCTCOUNT(data_chargeuses[Nom Conducteur]), data_chargeuses[Shift] = "Nuit-Matin", data_chargeuses[Date] = Next ) RETURN NuitSoirCount + NuitMatinCountSolved626Views0likes2Comments
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.