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
thegekko42
Frequent Visitor

Date Table With Direct Query

Hi

 

I have 2 direct queries from an sql server with no option to make changes in the source data setup.

 

One is an order query and the other an invoice query.

Sales_Data.pngInvoice_Data.png

I need to have a link between them in terms of date/month, but there is no date table in the source data.

 

I am aiming for this:

Charts.png

 

So comparing what has been ordered vs what has been invoiced per month and quarter.

But I can't find a way to achieve this with direct query.

 

I was tipped to the Composite Models, and I found that it solved the problem perfectly as I simply added this table and linked it to my queries

Month_Data.png

But the Composite Models are only in preview so I need to find a different solution.

 

How do I replicate the functionality of a date/month table without actually adding the table?

Is there a way around the problem while keeping it as direct query?

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @thegekko42,

 

If you use 'Composite Models', you need to switch to import then you can publish your report with 'many to many' relationship.


If you not want to use that feature, you need to create a bridge table with unique value to link both tables, but this also can't achieve in directquery mode. (calculate table has been disabled in directquery mode)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you for your reply Xiaoxin Sheng

 

Unfortunately I need to run on direct query, as this will need to be Live data.

 

Is there a measure solution or something like that which can help me bridge the two queries?

Hi @thegekko42,

 

You can consider to create this table on database side.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you for the suggestion, but I can't touch the source data setup.

 

For now I will keep a master of the model in Composite and then have an import copy for publishing.

 

It doesn't give me everything I need, but it will have to do until Composite goes Live in October.

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.