Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Solved! Go to Solution.
Hi @lnayak
Based on your formula, I created a simple sample.
Original data :
Then use the formula you provided . I modified it to return the value 1 or 0 .
HeadCount =
VAR selectedDate=MAX('Calendar'[Date])
VAR _WorkerStartDate= SELECTEDVALUE(EDE[MinStartDate])
VAR _WorkerEndDate = SELECTEDVALUE(EDE[MaxEndDate])
RETURN IF ( _WorkerStartDate<=selectedDate && _WorkerEndDate>=selectedDate,1,0)
Then create a measure to count the total value .
count = SUMX('EDE',[HeadCount])
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lnayak
Based on your formula, I created a simple sample.
Original data :
Then use the formula you provided . I modified it to return the value 1 or 0 .
HeadCount =
VAR selectedDate=MAX('Calendar'[Date])
VAR _WorkerStartDate= SELECTEDVALUE(EDE[MinStartDate])
VAR _WorkerEndDate = SELECTEDVALUE(EDE[MaxEndDate])
RETURN IF ( _WorkerStartDate<=selectedDate && _WorkerEndDate>=selectedDate,1,0)
Then create a measure to count the total value .
count = SUMX('EDE',[HeadCount])
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Let me explain what am looking for am trying to work on headcount formula and if sumx doesn't work i need to change it to distinct count. can someone help me out here please?
Hi Tamerj1,
The date filter in report would just be from the calendar.
Hi @lnayak
the first argument of SUMX is a table not a column. Besides no need to store column value in a variable just start with IF directly. But do you have to use SUMX?
Hi @tamerj1
Yes, I used table within SUMX. Yes, i want to use this function to know if i get the result.
Thanks,
Laxmi
You should if there is no other date filter on your visual
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
28 | |
21 | |
11 | |
8 |
User | Count |
---|---|
75 | |
51 | |
46 | |
16 | |
12 |