Forum Discussion
Historic Data by Week Number, Creating a Current Week X-Axis
- 7 years ago
Hi Anonymous,
Yes, I can.
Usually, only one date table is needed. Please refer to the snapshot below. There are two relationships while one is inactive.
// We don't need to use userealtionship() for the active relationship. _Incidents_Resolved = COUNTROWS(Incidents)
_Incident_Arrivals = CALCULATE ( COUNTROWS ( Incidents ), USERELATIONSHIP ( Added_Date[DATEKEY], Incidents[Added_Date_Key] ) )
Best Regards,
Hi Anonymous,
You need a date table in your scenario. And then create two relationships but only one is active. Finally you can calculate one value using a measure with userelationship-function-dax. It could be like below.
Measure = CALCULATE ( COUNTROWS ( 'table' ), USERELATIONSHIP ( 'calendar'[date], 'table'[Closed Week Number] ) )
Best Regards,
v-jiascu-msft Many Thanks for this. So here is my DAX
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Anonymous,
Can you share your file? Please mask the sensitive parts first.
Why are there so many date tables like Added_Date, Colsed_Date? Only one date table is needed.
Best Regards,
- Anonymous7 years agoNot applicable
v-jiascu-msft Again Thanks. The 2 date tables are there as a colleague suggested as we can't use the one date table to relationshiop between both dates hence 2 tables.
I will now go away and prep a file i can share
- Anonymous7 years agoNot applicable
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Anonymous,
Yes, I can.
Usually, only one date table is needed. Please refer to the snapshot below. There are two relationships while one is inactive.
// We don't need to use userealtionship() for the active relationship. _Incidents_Resolved = COUNTROWS(Incidents)
_Incident_Arrivals = CALCULATE ( COUNTROWS ( Incidents ), USERELATIONSHIP ( Added_Date[DATEKEY], Incidents[Added_Date_Key] ) )
Best Regards,