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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wmcclure
Frequent Visitor

Trying to make custom flag for in market and out of market time bwteen 2 tables

I am trying to make a simple comparison for time entries that looks as if the service location of a time entry is the same as the employee home branch, the time entry lives in its own table with the service location, and has a many to one relationship with cross directional filtering with the employee table which houses that persons home location.

 

The dax I have currently is as follows:

 

Out of Market Flag = IF(EXACT(Time_Entry[Service Location], 'Member'[Employee Location]), "In Market", "Out of Market")
 
I have tried a few different variations but I cant seem to get the function to want to take the service location and employee location as inputs. I am sure what I am missing is simple but for the life of me I cant seem to find an example of this online to use for comparison.
 
Thanks in advance!
1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @wmcclure 

 

I would like to apologize for the belated reply.

 

Have you solved your problem? If it's not resolved, you can try the following methods.

 

Replace measure with the following:

 

 

Out of Market Flag = IF(EXACT(SELECTEDVALUE(Time_Entry[Service Location]), SELECTEDVALUE('Member'[Employee Location])), "In Market", "Out of Market")

 

 

My sample:

vxuxinyimsft_0-1706519518059.png

 

vxuxinyimsft_1-1706519530178.png

 

vxuxinyimsft_2-1706519555841.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

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

View solution in original post

6 REPLIES 6
v-xuxinyi-msft
Community Support
Community Support

Hi @wmcclure 

 

I would like to apologize for the belated reply.

 

Have you solved your problem? If it's not resolved, you can try the following methods.

 

Replace measure with the following:

 

 

Out of Market Flag = IF(EXACT(SELECTEDVALUE(Time_Entry[Service Location]), SELECTEDVALUE('Member'[Employee Location])), "In Market", "Out of Market")

 

 

My sample:

vxuxinyimsft_0-1706519518059.png

 

vxuxinyimsft_1-1706519530178.png

 

vxuxinyimsft_2-1706519555841.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

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

Fowmy
Super User
Super User

@wmcclure 

Create the following calculated Column in your Time Entry table:

Out of Market Flag =
IF (
    Time_Entry[Service Location] = RELATED ( 'Member'[Employee Location] ),
    "In Market",
    "Out of Market"
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I am still getting the red underlines, it wont let me use it on any viusals either. Is there a debug tool I might be missing that can tell me why the statement is failing?

 

@wmcclure 

Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Unfortunately I dont think I would be comfortable doing as such. This dataset contains information like employee compensation, If it comes down to it I can go into power query, I was just hoping that there was some sort of step I missed to get DAX to accept the text fields for comparison

@wmcclure 

Sorry, without having a clear understanding of your model, suggesting solutions will be hard.
If you could create a dummy model to represent your case then it will be helpful.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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