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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Jack_Reacher
Helper I
Helper I

Need help improving DAX calculations for accurate results in Power BI from single date column!

Hello Power BI community!

I'm seeking your expertise to help me improve two DAX calculations that I'm currently using to calculate the receiving and sending (handling) dates for a ticket table. The data I'm dealing with is related to a list of tickets that are received and then treated by technicians on different dates, unfortunately, I'm only provided with one date column which aggregates all actions performed on a specific ticket (which is DateTime), and a ticket may appear repetitively but with different receiving and sending dates (which should be taken into account of course). 

Here's a snapshot from the raw data table:

Feel free to download these tables from here: "https://smallpdf.com/file#s=c745e973-29a0-4dbd-85ab-2472d7379858"

Jack_Reacher_0-1685550171813.png


Below are the DAX calculations I'm using to produce the results (which are now inaccurate)

ReceiverDate = 
CALCULATE(
MIN(WEEKLY_IDs[DateTime]),
FILTER(
ALL('WEEKLY_IDs'),
'WEEKLY_IDs'[SenderID] = EARLIER('WEEKLY_IDs'[ReceiverID]) &&
'WEEKLY_IDs'[ReceiverID] = EARLIER('WEEKLY_IDs'[SenderID]) &&
'WEEKLY_IDs'[Ticket_ID] = EARLIER('WEEKLY_IDs'[Ticket_ID])
)
)

SenderDate =
CALCULATE(
MAX([DateTime]),
FILTER(
ALL('WEEKLY_IDs'),
'WEEKLY_IDs'[SenderID] = EARLIER('WEEKLY_IDs'[SenderID]) &&
'WEEKLY_IDs'[ReceiverID] = EARLIER('WEEKLY_IDs'[ReceiverID]) &&
'WEEKLY_IDs'[Ticket_ID] = EARLIER('WEEKLY_IDs'[Ticket_ID])
)
)
 

Jack_Reacher_2-1685550363911.png


These are the end results I'm seeking to accomplish with these two DAX calculations:

Jack_Reacher_3-1685550407765.png

 

 

0 REPLIES 0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors