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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mohammadyousaf
Resolver II
Resolver II

Getting dates from different tables into main tables

Hi, can someone please help me with a dax..

 

I have imported data from SQL and there are more than 80 tables.. the sample is like this

Table 1

Task IDTask NameStar DateEnd Date 
1A  
2B  
3C  
    

 

Table 2 - Task ID-1

 

Task IDDate
1 
1 
1 
1 

 

Table 3 - Task ID-2

 

Task IDDate
2 
2 
2 
2 

 

I have several such tables .. I want to calculate min & max date and insert them in table-1 in Start & End Date.

 

My relationship are one to many for these tables. 

Thank you.  

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @mohammadyousaf ,

 

According to your description, refer to the following formula whether it can meet your needs.

M_min = 
CALCULATE (
    MIN ( Table_dimension[Date] ),
    FILTER ( ALL ( Table_1 ), Table_1[Catesgory] = MAX ( Table_1[Catesgory] ) )
)

M_max =
CALCULATE (
    MAX ( Table_dimension[Date] ),
    FILTER ( ALL ( Table_1 ), Table_1[Catesgory] = MAX ( Table_1[Catesgory] ) )
)

vhenrykmstf_1-1643686161037.png

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your feedback.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @mohammadyousaf ,

 

According to your description, refer to the following formula whether it can meet your needs.

M_min = 
CALCULATE (
    MIN ( Table_dimension[Date] ),
    FILTER ( ALL ( Table_1 ), Table_1[Catesgory] = MAX ( Table_1[Catesgory] ) )
)

M_max =
CALCULATE (
    MAX ( Table_dimension[Date] ),
    FILTER ( ALL ( Table_1 ), Table_1[Catesgory] = MAX ( Table_1[Catesgory] ) )
)

vhenrykmstf_1-1643686161037.png

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your feedback.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you.. it worked only for one table for me since I don't have date table. Each Table has its own dates and I am unable to connect it to date table as my data model is very complex, let's say around 100 tables imported from SQL. 

Can you please assist me on creating variable and collecting dates or quantity from rest of the tables. 

Thanks. 

Greg_Deckler
Super User
Super User

@mohammadyousaf I think the first thing you should do is to append all of your Task ID tables together. Then you could create a single relationship and pretty much done.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I already have a table with Task ID which is table-1, I need to collect the max and mi date against each ID from the corresponding tables. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.