Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I would like to write a Dax formula, counting number of Days based on Product ID. I do not have the start and end date in two diff columns.
Thanks Much Appreciated.
Solved! Go to Solution.
CalculatedColumn=VAR _prev=MAXX(FILTER(Table,Table[Product]=EARLIER(Table[Product])&&Table[Date]<EARLIER(Table[Date])),Table[Date] RETURN IF(_prev,Table[Date]-_prev)
Measure=VAR _Curr=MAX(Table[Date]) VAR _Prev=CALCULATE(MAX(Table[Date]),Table[Date]<_Curr) RETURN IF(_Prev,_Curr-_Prev)
Thanks!
CalculatedColumn=VAR _prev=MAXX(FILTER(Table,Table[Product]=EARLIER(Table[Product])&&Table[Date]<EARLIER(Table[Date])),Table[Date] RETURN IF(_prev,Table[Date]-_prev)
Measure=VAR _Curr=MAX(Table[Date]) VAR _Prev=CALCULATE(MAX(Table[Date]),Table[Date]<_Curr) RETURN IF(_Prev,_Curr-_Prev)