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

Recalculate RELATED column in imported table based on Direct Query table

I am having an issue with a composite model where my table that is using a calculated column to get data from a table in Direct Query is not updating when a slicer is applied, it will only update when a refresh occurs. 

 

My dimension table contains all the IDs that are in the Daily Data table, these are calculated based on a rule and not imported from the table, but do not have the DateTime value for it. The DateTime needs to be looked up by ID in the Daily Data table and update when there is a new ID in the Daily Direct query table. 

 

My looks like this:

relationshipsrelationships

 

and my Dax to get the value from the daily table via calculated column is:

DateTime = IF('Dimension (Import)'[NZDT]=BLANK(),MAXX(RELATEDTABLE('Daily Data (Direct Query)'),'Daily Data (Direct Query)'[DateTime]),'Dimension (Import)'[NZDT])

 

Note: I have used RELATEDTABLE as RELATED has a bug in direct query as noted here. I have also tried LOOKUPVALUE but this has the same issue.

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 


For tables in import mode,  calculated columns are computed during the database processing and then stored in the model. So In your scenario, we cannot make the calculated column dynamically by DirectQuery table or slicer.

 

We can try to use a measure to show the datetime dynamically:

 

DateTime_Measure =
IF (
    SELECTEDVALUE ( 'Dimension (Import)'[NZDT] )
        = BLANK (),
    CALCULATE (
        MAX ( 'Daily Data (Direct Query)'[DateTime] ),
        'Daily Data (Direct Query)'[id]
            = SELECTEDVALUE ( 'Dimension (Import)'[id] )
    ),
    SELECTEDVALUE ( 'Dimension (Import)'[NZDT] )
)


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-lid-msft,

Thanks for this, however since I want to be able to display datetime information on the x axis of a graph I don't believe your solution will work. 

 

Is my only option to put my dimension table in DQ mode?

 

There is no way to incrementally load DQ data while keeping the majority of data in Import mode and only getting the latest data and appending to my dimension table? 

 

The reason for this is that this is IoT data that needs to come in as soon as its in the database and we are seeing much-degraded performance when loading all the data in DQ mode (>100 second queries). 

Cheers, 

MG

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.