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
FabricGuy
Employee
Employee

DAX Help needed

Hi

 

I am struggeling with a DAX function and hope somebody can help me. I have three different tables (M, P, R). In my R table I have a timestamp for every ID. In my P table I have a timestamp as well but it occurs multiple times for the same ID. What I need to achieve is to finde the earliest timestamp from my P table and calculate the datediff with my timestamp from my R table. The connection between those two tables is made through my M table. I have a P GUID in my P and my M table and have a R GUID in my R and my M table. The M table has as well a GUID.

 

Thanks for any help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

I assume that you want to Create this Difference in the R Table which contains of all Unique Values. You would need to add a new column with the below Expression. This would Calculate the MIN Date from the P Table for its Corresponding ID in R Table.

Min_Date:=DATEDIFF(DATE(YEAR(R[Timestamp]), MONTH(R[Timestamp]),DAY(R[Timestamp])),
CALCULATE(MIN(P[Time_Stamp]), TREATAS(VALUES(R[ID]), P[ID] )),DAY) 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi,

 

I assume that you want to Create this Difference in the R Table which contains of all Unique Values. You would need to add a new column with the below Expression. This would Calculate the MIN Date from the P Table for its Corresponding ID in R Table.

Min_Date:=DATEDIFF(DATE(YEAR(R[Timestamp]), MONTH(R[Timestamp]),DAY(R[Timestamp])),
CALCULATE(MIN(P[Time_Stamp]), TREATAS(VALUES(R[ID]), P[ID] )),DAY) 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

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