Forum Discussion
Ahak
3 years agoFrequent Visitor
DAX Calculate Duration
Hi I have a table which shows production time. Always when I get new produced product i get a new entry. I have column with an category and this category can change over the the day couple...
- 3 years ago
Hi nvprasad
I Could it solve it by myself.
many thanks, anyway.
DurationNew7 = VAR CurrentRowID = tabelle2[ID] VAR CurrentCategory = tabelle2[Category (Text)] VAR PreviousRowID = CurrentRowID - 1 VAR PreviousRowCategory = CALCULATE( MIN(tabelle2[Category (Text)]), FILTER(tabelle2, tabelle2[ID] = PreviousRowID) ) VAR PreviousRowTime = CALCULATE( MAX(tabelle2[DateandTime]), FILTER(tabelle2, tabelle2[ID] = PreviousRowID) ) RETURN IF( PreviousRowCategory <> CurrentCategory && NOT(ISBLANK(PreviousRowCategory)), (tabelle2[DateandTime] - PreviousRowTime) * 24 * 60, BLANK() )
Ahak
3 years agoFrequent Visitor
Hi Parsad,
Here is an DropBoxLink to the pbix file.
https://www.dropbox.com/s/iw7f6e52cq6hsfc/Sample_File.pbix?dl=0
Many thanks,