Forum Discussion
Calculate previous Day together
- 2 years ago
azaterol , if you are currently using one measure in matrix visual. You can use 2 and use option Switch values on rows.
the second measure can be a distinct count for the last 2 days. Prefer date table, joined with the date of your table
Rolling 2 = CALCULATE(distinctcount('Customers'[ID]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-2,day))
- Anonymous2 years ago
Hi amitchandak ,thanks for the quick reply, I'll add more.
Hi azaterol ,
The Table data is shown below:
Use the following DAX expression to create a measure
Measure2 = VAR _currentDate = SELECTEDVALUE ( 'Table'[Date] ) VAR _previousDate = _currentDate - 1 RETURN CALCULATE ( COUNTROWS ( DISTINCT ( 'Table'[Member ID] ) ), ALL ( 'Table'[Date] ), 'Table'[Date] >= _previousDate && 'Table'[Date] <= _currentDate )Final output
Best Regards,
Wenbin Zhou
azaterol , if you are currently using one measure in matrix visual. You can use 2 and use option Switch values on rows.
the second measure can be a distinct count for the last 2 days. Prefer date table, joined with the date of your table
Rolling 2 = CALCULATE(distinctcount('Customers'[ID]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-2,day))