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

Find First date from another table

Hello, need some help,

 

I have date table and sales table, they are connected through column Year+month. Relationship direction "Both" is for another calculations.

First date in Sales table is 2019 January, and in Date 2018- 01-01.

 

I need to find first date of sales table in measure, but I can't figure out how.

The result should be table visualization with columns:

Date[Year]/Date[Month]/First date of sales - 2019-01-01/Sales[EF Sales]

Can you help me? 

This is pbix example https://drive.google.com/open?id=1ucr1iKxHayG1ckPt-B8aeTb9v3ZFbVnD

 

 

 

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 
You should have looked at the Date column in the Sales Table instead of the Date Table, and FIRSTDATE is used on Dates column, but the Sales[date] is a whole number data type.

 

In this case, you can use MIN to find the smallest date, and remember you can also use MIN on the Dates type columns.

 

First date = MINX(ALL(Sales),Sales[Date])

 


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

Anonymous
Not applicable

Thanks, @V-pazhen-msft  and @amitchandak 

 

Maybe I didn't clarify enough the need.

In sales table I don't have date, I have combination of Year and month and  it should bring first value of Date table.

And also in every line it should remain the same.
There is some picture, and example file is in previous message.

Capture2.PNG

Thanks,

amitchandak
Super User
Super User

You can get min date like

First sales Date = minx(Sales,Sales[Sales Date])

 

If need you can format like = format(First sales Date = minx(Sales,Sales[Sales Date]),"YYYY-MM-DD")

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.