Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 months ago
Solved

Create Measure Displaying Data from Previous Working Day

Hi All,

 

I have a Calendar table with the previous working day already implemented as a column:

 

I am looking to create a measure to show only a value which relates to that day, as such:

PreviousDayEmployees = CALCULATE([UniqueEmployees],
                                               applicable_date = LastWorkDay)


I also tried to create a measure to use in place of LastWorkDay, as below:

PrevWorkingDay1 = CONVERT(CALCULATE(
MAX('Calendar Master Table'[LastWorkDay]),
'Calendar Master Table'[LastWorkDay] < TODAY()), DATETIME)

 

This seems to function as intended.

 

I then created a CALCULATE statement:
PrevWorkingDayEmployees = CALCULATE(
[Unique Employees],
FILTER('MSite FILO', 'MSite FILO'[applicable_date] = [PrevWorkingDay1]))

 

However, this is returning no values.

 

Any insight?

 

Cheers!

5 Replies

  • Pls try 

    PrevWorkingDayEmployees = CALCULATE(
    [Unique Employees],
    FILTER(ALL('MSite FILO'), 'MSite FILO'[applicable_date] = [PrevWorkingDay1]))
    
    ---------------
    PrevWorkingDayEmployees = CALCULATE(
    [Unique Employees],
    'MSite FILO'[applicable_date] = [PrevWorkingDay1])

    and you should have a data type here [applicable date] = DATETIME
    I don't understand why you need to convert the data here to DATETIME.
    PrevWorkingDay1 = CONVERT(...., DATETIME)
     

  • v-achippa's avatar
    v-achippa
    Community Support

    Hi Anonymous,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you Ahmedx for the prompt response.

     

    As we haven’t heard back from you, we wanted to kindly follow up to check if your issue is resolved? 

    If not, please provide sample data that covers your issue or question completely. And please show the expected outcome based on the sample data you provided.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • v-achippa's avatar
      v-achippa
      Community Support

      Hi @Jamesfindog,

       

      We wanted to kindly follow up to check if your issue is resolved? If not, please provide sample data that covers your issue or question completely. And please show the expected outcome based on the sample data you provided.

       

      Thanks and regards,

      Anjan Kumar Chippa