Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Displaying a Blank for a Date Calculation

Hi all,   I'm trying to put together a visual that will show when product is received vs the anticipated delivery date. I've managed to set up a custom column to calculate the days difference betwe...
  • PhilipTreacy's avatar
    PhilipTreacy
    5 years ago

    Hi Anonymous 

    DAX and M (Power Query) are different languages and you can't use the same commands in both.  The DAX code I supplied

    Column = IF( OR( ISBLANK([Last Received Date]) , ([Last Received Date] - [Scheduled Date]) < 0 ), BLANK() , [Last Received Date] - [Scheduled Date] )

     

    will not work in Power Query.

     

    It's a completely different set of function names and syntax.

    Thats why I supplied a PBIX file with some code in Power Query that does what you want using this code to create a Custom Column

    = Table.AddColumn(#"Changed Type", "Days Early or late", each [Last Received to Stock] - [Scheduled Due Date])

     

    You need to download my PBIX file and look at the code in Power Query then try to apply it to your code.  

     

    Download PBIX file

     

    If you can't get it to work I can't do much more without seeing your Power Query code and at least a sample of your data in Power Query.

    Regards

    Phil