Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
apeeltyler
Frequent Visitor

Need help creating a new Measure to filter on a Table

I don't really know how I should lable my question, but I have the following DAX Measure to give me Current Employees for any Point In Time basically.  This one works great, but now I need to filter to also include people that are considered Sr. Management which consists of Executive Team, Sr Vice President, Vice President.

 

Current Employees = 
CALCULATE (
    COUNTX (
        FILTER (
            Roster,
            Roster[Hire Date] <= MAX ( 'Calendar'[Date] )
                && (
                    ISBLANK ( Roster[Termination Date] )
                        || Roster[Termination Date] > MAX ( 'Calendar'[Date] )
                )
        ),
        ( Roster[Employee Id] )
    ),
    CROSSFILTER ( Roster[Hire Date], 'Calendar'[Date], NONE )
)

 

 

I can get a the following DAX Measure to work, but I think having a Measure like the one above would be better, but don't know how to create it.

 

C_SrMgmt = 
CALCULATE ( COUNTROWS ( Roster ), Roster[Management Level] IN { "Vice President", "Sr Vice President", "Executive Team" })

 

 

I can get one Table for All Sr Mgmt (includes Males& Females), Female Sr Mgmt, and where I'm struggling is having one Table to include this count vs having multiple tables.  I'm not sure how I need to build my Measure to capture this.

apeeltyler_0-1695736191277.png

 

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @apeeltyler 

 

Are you able to provide some of the source data for testing? All the fields involved in the formula are needed. 

Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

apeeltyler
Frequent Visitor

I was able to come up with this.  Does anyone have a better method for writing this?

 

SrMgmt_Female = 
CALCULATE (
    COUNTX (
        FILTER (
            Roster,
            Roster[Hire Date] <= MAX ( 'Calendar'[Date] )
                && (
                    ISBLANK ( Roster[Termination Date] )
                        || Roster[Termination Date] > MAX ( 'Calendar'[Date] )
                )
                && ( Roster[Management Level]
                IN { "Vice President", "Sr Vice President", "Executive Team" } )
                && Roster[Gender] = "Female"
        ),
        ( Roster[Employee Id] )
    ),
    CROSSFILTER ( Roster[Hire Date], 'Calendar'[Date], NONE )
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.