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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Create New DAX Table

Hello,

I have the table below and needed to get a calculated value from it. i need the datediff between the dates and blue, then the datediff between the dates in green. These dates specifically because it has to be the start of operation 200 and end of operation 700. There are hundreds of WorkIDs in the list so i cant do it manually. My idea was to make a new table with just the underlined columns and the highlighted value in each column, and each row would be a different WorkID,  but i couldnt quite figure out the filtering method. Any help would be appreciated. 

throughput help.png

 

 

1 ACCEPTED SOLUTION
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @Anonymous try the following:

CUR Date Difference = 
VAR _Start = CALCULATE( MIN( table[START_CUR] , table[OPERATID] = "200" ) //I think that is text?
VAR _End = CALCULATE( MAX( table[END_CUR] , table[OPERATID] = "700" ) //I think that is text?
RETURN
_End - _Start

Actual Date Difference =
VAR _Start = CALCULATE( MIN( table[START_ACTUAL] , table[OPERATID] = "200" ) //I think that is text?
VAR _End = CALCULATE( MAX( table[END_ACTUAL] , table[OPERATID] = "700" ) //I think that is text?
RETURN
_End - _Start

 

 

 

 

 

 

View solution in original post

2 REPLIES 2
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @Anonymous try the following:

CUR Date Difference = 
VAR _Start = CALCULATE( MIN( table[START_CUR] , table[OPERATID] = "200" ) //I think that is text?
VAR _End = CALCULATE( MAX( table[END_CUR] , table[OPERATID] = "700" ) //I think that is text?
RETURN
_End - _Start

Actual Date Difference =
VAR _Start = CALCULATE( MIN( table[START_ACTUAL] , table[OPERATID] = "200" ) //I think that is text?
VAR _End = CALCULATE( MAX( table[END_ACTUAL] , table[OPERATID] = "700" ) //I think that is text?
RETURN
_End - _Start

 

 

 

 

 

 

Anonymous
Not applicable

Thank you, this did get me to my solution. A minor but key change is that there should be a closed paranthesis after the first entry of the min/max functions. i also changed both funtions to min since there was only one value for each operation (so both min and max are same number. And i used Datediff to get a number value. Thank you so much!

 

ActualDateDifference =
VAR _Start = CALCULATE( MIN( WOR_OPERATION[START_ACTUAL]) , WOR_OPERATION[OPERATID] = "200")
VAR _End = CALCULATE( MIN( WOR_OPERATION[END_ACTUAL]) , WOR_OPERATION[OPERATID] = "700")
RETURN
Datediff(_End, _Start,DAY)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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