Forum Discussion
Dax Formula
- 4 years ago
Hi,
According to your description, I can roughly understand your requirement, I think you can try to use this method to achieve your requirement:
This is the test data I created based on your description:
First you can create a calendar table to place into the date slicer as the selected date, you can change the date range based on your dataset:
Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,1,5))Then you can create a measure like this:
Count of diff = var _selecteddate=SELECTEDVALUE('Calendar'[Date]) var _CountofStart=COUNTX(FILTER(ALL('Table'),[StartDate]=_selecteddate),'Table'[StaffNameStringId]) var _CountofEnd=COUNTX(FILTER(ALL('Table'),[EndDate]=_selecteddate),'Table'[StaffNameStringId]) return _CountofStart-_CountofEndAnd you can create a date slicer and a card chart to get what you want, like this:
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
According to your description, I can roughly understand your requirement, I think you can try to use this method to achieve your requirement:
This is the test data I created based on your description:
First you can create a calendar table to place into the date slicer as the selected date, you can change the date range based on your dataset:
Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,1,5))
Then you can create a measure like this:
Count of diff =
var _selecteddate=SELECTEDVALUE('Calendar'[Date])
var _CountofStart=COUNTX(FILTER(ALL('Table'),[StartDate]=_selecteddate),'Table'[StaffNameStringId])
var _CountofEnd=COUNTX(FILTER(ALL('Table'),[EndDate]=_selecteddate),'Table'[StaffNameStringId])
return
_CountofStart-_CountofEnd
And you can create a date slicer and a card chart to get what you want, like this:
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.