The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
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
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
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!
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |