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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Gaurav_Lakhotia
Helper III
Helper III

Calculated Column for Latest Training Date

Hi All,

 

I need help in calculating the calculated column for latest date.

 

Scenario is, There is a TrainingTracker table which has Date column (i.e. Training Date).

I need to find out the date after 28 days of the Training Date. (For Example: If Training Date is 1st Sept 2020 than Latest Date will be 29th Sept 2020 i.e 1 Sept 2020 + 28 Days )

In case a second training was conducted within 28 days period of training for same Customer, the period end date will be a 28 days after second training. For Example: First Training Date is 1st Sept 2020 and within 28 days of First Training we've another Training on 15th Sept 2020, than the latest date will be 13 Oct 2020 i.e. 15th Sept + 28 Days, for both training.

 

Here is the file with sample data,

 Sample File 

 

Please help me out.

Thanks.

2 ACCEPTED SOLUTIONS

@Gaurav_Lakhotia , From what I got.

You can have new column which tell diff from last training and you can use that

new column =
Datediff( maxx(filter(table ,[Customers Name] = earlier([Customers Name]) && [TrainingDate] <earlier([TrainingDate])),[TrainingDate]),[TrainingDate],day)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

Hi @amitchandak ,

 

The DAX you've shared is calculating by taking very first Customer Training date as a base.

 

We want it to consider every corresponding training date of each row to search within 28 days after training.

 

Thanks

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@Gaurav_Lakhotia I will look at PBIX but could you just use:

 

New Column = [Training Date] + 28

New Column 1 = IF([Second Training Date] < [New Column],[Second Training Date]+28,<something else>)

 



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...

Hi @Greg_Deckler ,

 

We've Customer Name column. We've to lookup training dates customer wise. Here is sample data, look for first 2 entries of Sweet House Day Spa. We've 6 May 2020 and 16 May 2020.

 

TrainingDate   Trainer'sName           Trainer'sType                                                         Customer's Name

02-09-2020Jessica   Building a Strong Front Desk TeamSweet House Day Spa - Houston
04-09-2020BrittanyBuilding a Strong Front Desk Team101 Skin Lab 
06-09-2020BrittanyInventory Control / Product ManagementA New Leaf Flowers, Gifts, & More
06-05-2020BrittanyAdvanced Modality TreatmentsSweet House Day Spa
18-06-2020JenniferAdvanced Modality TreatmentsAidan James Salon
26-06-2020WendyAdvanced Modality Treatments101 Market
16-06-2020JessicaBuilding a Strong Front Desk TeamSweet House Day Spa
07-09-2020BeckyBuilding a Strong Front Desk Team502 Flair
23-05-2020BrittanyAdvanced Modality TreatmentsSweet House Day Spa

@Gaurav_Lakhotia , From what I got.

You can have new column which tell diff from last training and you can use that

new column =
Datediff( maxx(filter(table ,[Customers Name] = earlier([Customers Name]) && [TrainingDate] <earlier([TrainingDate])),[TrainingDate]),[TrainingDate],day)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @amitchandak ,

 

The DAX you've shared is calculating by taking very first Customer Training date as a base.

 

We want it to consider every corresponding training date of each row to search within 28 days after training.

 

Thanks

@Gaurav_Lakhotia , Please find the file attached after the signature. I created 2 columns to see if those can help.

Column names are different as they did not get pasted correctly

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Got the solution.
Thank you @amitchandak 

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!

December 2024

A Year in Review - December 2024

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