Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Column reference to 'Date' in table '...' cannot be used with a variation 'Date'

Hello, I am running into an error that occurs when I try to couple two different actions in Power BI. Action 1 - I am creating a new column that finds the corresponding value for the same day the previous month base on the Date column (confirmed Date Type format) and this value is called 'Lease Payment (Cash Basis)'. This is the DAX formula we are using: =CALCULATE( MIN('Table'[Value]), ALLEXCEPT('Table'[Value2]), PREVIOUSMONTH('Table'[Date].[Date]) ) Action 2 - I am using the approach found if you Google “Currency conversion for Power BI and SSAS” by Kasper On BI. I tried to input the URL via the LINK tool and directly as text, but it appears to be causing an issue. Both of these approach work for me separately. But when I create the required relationships for Action 2 as shown below, I get the error message for the DAX formula in Action 1, also shown below:

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I am sorry the formatting above is horrible, I am having a nightmare with this website today.  This was my 4th attempt at posting this question.  Not sure what I'm doing wrong.  Trying to upload the screen shots again as those failed to post with the rest of it.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable
      Using the automatically created date hierarchy is a SURE way to screw things up in no time. Please create a proper Calendar.

      Also, if you have a big fact table, using CALCULATE in a calculated column will slow things down so much that sometimes it'll not come to a stop.

      PREVIOUSMONTH works correctly only on a proper Data table. Never on a column in a fact table.

      Best
      D
      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks for bringing the importance of the CALENDAR table to my attention. 

         

        I have gone ahead and created this table in my model.  Then in the relationship (attached in original message) I put this table between the Lessor/Lessee Data table and the Exchange Data table connected by the date fields.  The same error persists, however.

         

        Is this error message one that you would expect to find if the CALCULATE function is causing the custom column to time out/stop?

         

         

        Thanks,

        Alex