The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am sure there is a easy change I need to make to get my slicers to work. But I am not sure what it is.
This measure is counting how many employees we had active within a given timeframe. The problem is that the filter functions and all function have caused any slicer to not work with it. I am wondering what tweak I can make to have it filter with the slicers I have.
Hi @ShawnG2G2 ,
Please try:
Measure =
VAR selectedDate =
MAX ( 'calendar'[Day_Date] )
VAR result =
CALCULATE (
COUNTROWS ( 'Paycom EmployeeDemographics' ),
FILTER (
ALLSELECTED ( 'Paycom EmployeeDemographics' ),
'Paycom EmployeeDemographics'[HireDate] <= selectedDate
&& (
'Paycom EmployeeDemographics'[TerminationDate] >= selectedDate
|| 'Paycom EmployeeDemographics'[TerminationDate] = BLANK ()
)
)
)
Var Rehireresult =
IF (
COUNT ( 'Paycom EmployeeDemographics'[including rehired] ) = 2,
CALCULATE (
COUNTROWS ( 'Paycom EmployeeDemographics' ),
FILTER (
ALLSELECTED ( 'Paycom EmployeeDemographics' ),
'Paycom EmployeeDemographics'[RehireDate] <= selectedDate
&& (
'Paycom EmployeeDemographics'[TerminationDate] >= selectedDate
|| 'Paycom EmployeeDemographics'[TerminationDate] = BLANK ()
)
)
),
0
)
RETURN
result+Rehireresult
If this does not work, could you consider providing a sanitized file for testing? That would be helpful.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Thank you for the response! It does make the slicers work but the numbers change drastically by about 200. I am not sure why it does that.
Here is what the graph looks like:
Here is some of my data and how its setup:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
79 | |
77 | |
43 | |
39 |
User | Count |
---|---|
150 | |
117 | |
67 | |
64 | |
56 |