Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

Workdays Dax not working

Hello -

I have two tables - CalendarData & tblrma

CalendarData = Date table (Has a IsWorkday calculated column)

tblrma = facts table (Have total of 2 date fields that need checked)

 

The below DAX works in PowerPivot but does not work in PowerBI Desktop.  The error is: An invalid numeric representation of a date value was encountered.

 

= IF(AND([EstEmpty] = FALSE(), [POEmpty] = FALSE()),
        CALCULATE(Sum('CalendarData'[IsWorkday]),  
              DATESBETWEEN(CalendarData[Date], [estimatedate], [podate])), 
        Blank())

EstEmpty = test for blank (Checks for blank returns true false)

POEmty = Test for Blank (Checks for blank returns true false)

 

Any help is appreciated!

Raven

  • Anonymous's avatar
    Anonymous
    10 years ago

    This worked after I formatted the Estimate and PO date fields to date only (no time).  goofy - but it worked right after the format.

     

    Just in case anyone else was having problems. 

    Raven

6 Replies

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    I saw this error message in another post. Is [estimatedate] always before [podate]?

    • Anonymous's avatar
      Anonymous
      Not applicable

      No estimate date is not always before po date. 

      • MattAllington's avatar
        MattAllington
        Icon for Community Champion rankCommunity Champion

        So maybe that is the issue.  The syntax is From/To.  If from is after to, then maybe that is the issue.  You should test it.