Forum Discussion
Multiple Date Column slicer
- 7 years ago
You may try using CALCULATE Function to change the context.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
Hi,
Share some data and also show the expected result.
I need to calculate the number of days between the different completion types
Ffor example:
Z Completion - X Completion
10/15/2018 - 10/1/2018
goal is to measure cycle times for these three completion types
- AlB7 years agoCommunity Champion
You need to be less ambiguous describing what you want. I do not understand it.
A sample of the data model would also be helpful.
- nmeliasp7 years agoRegular Visitor
Here is an example of what i am trying to calculate. This would be a DATEDIFF between Completion X and Completion Y, however these columns were melted into an attribute->value columns when i did an unpivot action on them. Hope this helps...
Completion X Completion Y Completion Z Cycle Time X-Y Cycle Time Y-Z 10/1/2018 11/1/2018 12/1/2018 31 30 10/2/2018 11/12/2018 12/2/2018 41 20 10/3/2018 11/3/2018 12/3/2018 31 30 10/4/2018 11/14/2018 12/4/2018 41 20 10/5/2018 11/5/2018 12/4/2018 31 29 10/6/2018 11/16/2018 12/4/2018 41 18 10/7/2018 11/7/2018 12/4/2018 31 27 - AlB7 years agoCommunity Champion
So you already have it. A DATEDIFF and that is it. What is the problem?
- nmeliasp7 years agoRegular Visitor
my problem now is i did an unpivot action and now my columns look like this
Completion Type Completion Date Completion X 10/1/2018 Completion Y 11/1/2018 Completion Z 12/1/2018 I am trying to pivot these columns back but having trouble retainig the values. Is there a different way to calcuate the DATEDIFFs between these completion types withouth having to pivot the columns back?
- v-chuncz-msft7 years agoCommunity Support
You may try using CALCULATE Function to change the context.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/