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

Producing a text entry from another table in an IF statement

Hello,

 

Help please! I've done this before but for the life of me I can't remember how.

 

I have two tables which are joined by staff name: the Master Table includes staff details and the Absence Table includes absence details. The Master Table has been expanded to include a new row to represent each month of activity. I've already produced the total number of absences in the Master Table. Now I want to produce the reason given.

 

This forumala is wrong because you can't sum a text field, but it demonstrates what I'm trying to do.

 

UL - Reason = IF('Master Table'[In Month]=DATE(2018,04,01), CALCULATE(SUM('Absence Table'[Level 1 Reason]), 'Absence Table'[In Month]=DATE(2018,04,01)),
0)

 Can anyone help? RELATED('Absence Table'[Level 1 Reason]) doesn't seem to be working...

 

Tiff

1 ACCEPTED SOLUTION

you can concatenate the reasons in a single column (as comma seperated) and use the same lookup function to get that column value.

 

This Will give the name of the employees and the reasons (comma separeted values).

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

Hello @Anonymous 

You could try using LOOKUPVALUE like so:

UL - Reason = LOOKUPVALUE ( 'Absence Table'[Level 1 Reason], 'Absence Table'[In Month], 'Master Table'[In Month], 'Absence Table'[Staff Name], 'Master Table'[Staff Name] )
Anonymous
Not applicable

Ah yes that's ringing bells. This is saying a table of multiple values was selected, though...

Anonymous
Not applicable

Actually, that's probably because someone's had more than one instance (and therefore more than one reason) for an absence in a month, isn't it? If that's the case this isn't going to work...

you can concatenate the reasons in a single column (as comma seperated) and use the same lookup function to get that column value.

 

This Will give the name of the employees and the reasons (comma separeted values).

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.