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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
prita
Helper I
Helper I

Calculate min date with multiple columns

Hello,

 

I have a data table that looks like follows:

 

User IDProduct IDUsage Date
User112411/02/2019
User222305/18/2020
User389306/29/2019
User112411/03/2019
User112412/15/2019
User112401/03/2021
User445607/01/2021
User322303/05/2021

 

Each user has a unique ID to identify them, each product has a unique ID, but the table contains rows for all dates each user has used each product. I am trying to get the value of the first date when a user used a certain product. I have created a table (visual) where I have used the Usage date and summarized it by earliest, for example below.

User IDProduct ID First Used
User112411/02/2019
User222305/18/2020
User389306/29/2019
User322303/05/2021
User445607/01/2021

I need to add a date filter to the page such that when a date is selected from the filter it shows the correct earliest date value in the Table (visual).

I am using a simple date filter but when I select a year, it is changing the table to adjust to the earliest date in that year, for example, if I select the year 2021, I want to see these rows only

 

User IDProduct IDFirst Used
User445607/01/2021
User322303/05/2021

 

But now it is showing:

 

User IDProduct IDFirst Used
User112401/03/2021
User445607/01/2021
User322303/05/2021

 

Earliest date for User1 and Product ID 124 is in 2019, so it should show in 2019 only. The row should not appear when year 2021 is selected from date filter. 

1 ACCEPTED SOLUTION

Thanks! I used the following column and it seems to work for me:

Min date =

CALCULATE (

MIN ( table[USAGE_DATE] ),

ALLEXCEPT ( table, table[userID], table[PRODUCTID] )

)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@prita , create a measure like

and use in place of date


measure =
var _min = calculate(min(Table[Date]), allexcept(Table, Table[User Id],Table[Product ID]))
return
calculate(min(Table[Date]), filter(table, year(_min) = selectedvalue(table[date])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks! I used the following column and it seems to work for me:

Min date =

CALCULATE (

MIN ( table[USAGE_DATE] ),

ALLEXCEPT ( table, table[userID], table[PRODUCTID] )

)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors