Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a key named "teams" that has one column of team names. It has a one to many relationship with table masterall[team]. I used the teams table as the field in the slicer.
When I try to slice this measure...CountofActiveEmployee, it does not slice by team. Is there a way to modify this to be able to slice *This measure counts the number of active employees based on start and end dates and it works fine by itself but I need it to be able to be sliced.
DateTable1 is my date dimension
Count of Active Employee =
VAR endOfPeriod =MAX ( 'DateTable1'[Date] )
VAR startOfPeriod = MIN( 'DateTable1'[Date] )
RETURN
CALCULATE (
COUNTROWS ( MasterAll ),
FILTER (
ALL(MasterAll),
( MasterAll[Start Date] <= endOfPeriod
&& MasterAll[End Date] >= startOfPeriod
&& masterall[title]<>"non-billable"
&& masterall[title]<>"bench")
)
)
Solved! Go to Solution.
The likely problem is your ALL clause. You probably want to switch to ALLEXCEPT and include your Teams in your ALLEXCEPT.
https://msdn.microsoft.com/en-us/library/ee634795.aspx
The likely problem is your ALL clause. You probably want to switch to ALLEXCEPT and include your Teams in your ALLEXCEPT.
https://msdn.microsoft.com/en-us/library/ee634795.aspx
Worked like a charm!
Count of Active Employee =
VAR endOfPeriod =MAX ( 'DateTable1'[Date] )
VAR startOfPeriod = MIN( 'DateTable1'[Date] )
RETURN
CALCULATE (
COUNTROWS ( MasterAll ),
FILTER (
ALLexcept(MasterAll, 'Key Teams'[Teams]),
MasterAll[Start Date] <= endOfPeriod
&& MasterAll[End Date] >= startOfPeriod
&& masterall[title]<>"non-billable"
&& masterall[title]<>"bench")
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
60 | |
60 | |
49 | |
45 |