Forum Discussion
alexsr
6 years agoNew Member
Figuring Out Calculations Based on Relative Dates
So here's my problem, I'll simply the data set to the only things I need. Ultimately I'm trying to see how many hours are worked on a ticket, X days out from the ticket creation. In table 1, I h...
alexsr
6 years agoNew Member
Excellent thank you, that worked! And what about referencing the X in a slicer of some sort? How do I do that?
v-kelly-msft
Community Support
6 years agoHi alexsr ,
Create a slicer table as below:
Slicer Table = GENERATESERIES(1,30,1)
Then create a measure as below:
Measure =
var _mindate=CALCULATE(MIN('Table 2'[Worked date]),FILTER(ALL('Table 2'),'Table 2'[ticket name]=MAX('Table 2'[ticket name])))
var _mindiff=DATEDIFF(MAX('Table 2'[Created date]),_mindate,DAY)
Return
IF(SELECTEDVALUE('Slicer Table'[Value])<_mindiff,0,SUMX(FILTER(ALL('Table 2'),'Table 2'[ticket name]=MAX('Table 2'[ticket name])&&'Table 2'[Worked date]<=SELECTEDVALUE('Slicer Table'[Value])+MAX('Table 2'[Created date])),VALUE(LEFT('Table 2'[hours worked],1))))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!