The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I have a data table like below. The data table represent an temp worker with the start date and end date. I would like to get a count a daily count of temp worker starting- daily sum of temp worker ending there work. I am trying to get a net value per day. How would I be able to achieve this?
Solved! Go to Solution.
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.
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.
This link is helpful as well:
https://www.vahiddm.com/post/calculating-business-hours-in-power-bi-using-dax
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @Anonymous
You can use DATEDIFF to find the days between Start and End dates.
something like this:
DATEDIFF(table[StartDate], table[EndDate], Day)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
New Year Power BI eCard:
https://community.powerbi.com/t5/Data-Stories-Gallery/Happy-New-Year/td-p/2266398
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
13 | |
10 | |
10 | |
9 |