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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Phoenix_Bird
Frequent Visitor

DAX Measure - ALL EXCEPT?

I need to write a DAX measure to return a value of "In" or "Out" for each employee based on the values in the Description fields of relevant rows.

 

Any employee that has a row for "Furlough Pay" needs to return the value "Out" (even if other rows for that employee have different descriptions).If an employee doesnt have rows with "Furlough Pay" then it should return the value "In".

 

So in the image below employees 12, 14, 16 & 43 would be "Out" but emloyees 22 & 55 would be "In".

 

Employee CategoryMeasure
12Basic HoursOut
12Furlough PayOut
12Sick PayOut
14Basic HoursOut
14Furlough PayOut
14Sick PayOut
16Basic HoursOut
16Furlough PayOut
16Sick PayOut
22Basic HoursIn
43Basic HoursOut
43Furlough PayOut
55Basic HoursIn

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Phoenix_Bird 

Please check the below for creating a new measure.

 

Picture2.png

 

 

New Measure =
IF (
"Furlough Pay"
IN CALCULATETABLE (
VALUES ( 'Table'[Category] ),
ALLEXCEPT ( 'Table', 'Table'[Employee ] )
),
"Out",
"In"
)
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Phoenix_Bird
Frequent Visitor

Great, thank you both for your help. I created it as a column rather than a measure. 

PaulDBrown
Community Champion
Community Champion

@Phoenix_Bird 

Here is one way:

1) Create a Dimension table for with the distinct values for Employee, and set up the model like this:

model.JPG

 

2) Create the following two measures:

Furlough =
VAR Furlough =
    CALCULATETABLE (
        VALUES ( 'Dim Employee'[Employee ] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category] = "Furlough Pay" )
    )
VAR FRows =
    COUNTROWS ( INTERSECT ( VALUES ( 'Dim Employee'[Employee ] ), Furlough ) )
VAR class =
    IF ( FRows = 1, "OUT", "IN" )
RETURN
    class
table rows = COUNTROWS('Table')

Now create the table visual using the employee field from the dimension table, the category field from the main table, add the furlough measure and add the [table rows] measure as a filter for the visual in the filter pane setting the value to 1:

result.JPG

 

I've attached the PBIX file for your reference





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Jihwan_Kim
Super User
Super User

Hi, @Phoenix_Bird 

Please check the below for creating a new measure.

 

Picture2.png

 

 

New Measure =
IF (
"Furlough Pay"
IN CALCULATETABLE (
VALUES ( 'Table'[Category] ),
ALLEXCEPT ( 'Table', 'Table'[Employee ] )
),
"Out",
"In"
)
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors