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

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.

Reply
Anonymous
Not applicable

Trying to exclude values from one colum and count from another

Hello I am trying to disctinct count one colum and exclude values of another 

 

I have this calculated dax but I am not getting the results that I am looking for 

 

Count of inactive Users Training =
CALCULATE(
    COUNTA('Training__Global__by_Business_U'[User]),
    'Training__Global__by_Business_U'[Timesheets - Approved hours]
        IN { 0 }
)
 
Then I tried doing this 
 
Test Exclude double user cout =
CALCULATE(
DISTINCTCOUNT(Training__Global__by_Business_U[User]) ,
    'Training__Global__by_Business_U'[Timesheets - Approved hours]
IN { 0 }
)
 
With those two I am not getting the results that I am looking for please help me I want to distinct count the users and exclue Zero values for the approved hours
3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

I'd like to suggest you try the following measure to see if it works.

Test Exclude double user cout =
CALCULATE (
    DISTINCTCOUNT ( Training__Global__by_Business_U[User] ),
    'Training__Global__by_Business_U'[Timesheets - Approved hours] <> 0
)

Or

Test Exclude double user cout =
CALCULATE (
    DISTINCTCOUNT ( Training__Global__by_Business_U[User] ),
    FILTER (
        'Training__Global__by_Business_U',
        'Training__Global__by_Business_U'[Timesheets - Approved hours] <> 0
    )
)

 

Best Regards

Allan

 

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

Anonymous
Not applicable

Hi Allan, 

 

Thanks for sending these over however I have just tried and they are both still giving me the total count of users and not excluding any of the zero values for the approved hours 

Hi, @Anonymous 

 

Could you please show us some sample data and expected result with OneDrive for business? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors