Forum Discussion

mrg64's avatar
mrg64
Frequent Visitor
8 years ago
Solved

Calculating Days Between a Date and Today

I am trying to calculate the days between a date and today but I don't succed...   I've created a new column :  DaysInWarehouse = DATEDIFF('caapps PackageHeader (2)'[WarehouseInDate];TODAY();DAY) ...
  • v-piga-msft's avatar
    8 years ago

    Hi mrg64,

     

    I have made a test by entering the date and creating the Calculated Column with your dax expression in Power BI Desktop (Version: 2.56.5023.942 64-bit (March 2018)), everything works as expected.

     

     

    Please check if you have update to the latest Power BI Desktop and have a try.

     

    What data source have you connected with and  how to connected it?

     

    If you connected  by Direct Query, there should be some limitations.

     

    • Limitations in calculated columns: Calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. Additionally, the DAX scalar functions (such as LEFT()) that are allowed, will be limited to those which can simply be pushed to the underlying source, hence will vary depending upon the exact capabilities of the source. Functions that are not supported will not be listed in autocomplete when authoring the DAX for a calculated column, and would result in an error if used.

     

    If you need additional help , please share your data structure.

     

    Best Regards,

    Cherry