Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 5
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.

 

Conversion Relationships.PNG

 

Error Message.PNG

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
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?

 

Conversion Relationships v2.PNG

 

Thanks,

Alex

Anonymous
Not applicable

Once you have a Calendar table in your model, you CANNOT use any other date field that's connected to this table. All columns in your fact tables MUST be hidden. Please watch this to learn about good modeling habits:

https://www.youtube.com/watch?v=_quTwyvDfG0

and

https://www.youtube.com/watch?v=78d6mwR8GtA&t=1247s

Here's material on time-intel:

https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/

Best
D
Anonymous
Not applicable

ExchangeDate is completely unnecessary. One of the reasons is the 1-1 connection between this table and Calendar.

Best
D

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors