March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I haven't quite found my exact issue in an existing forum post; if there's something already out there on this topic I'd be happy to take a look.
I have a table that contains a list of Contact IDs - each numerical ID corresponds to a person. I have two other tables with active relationships to this table - one is a table that has a list of Contact IDs for competitors, and one that is a table that has a list of Contact IDs for alumni.
In my All Contacts table, I have created two calculated columns (CompetitorSwitch and AlumniSwitch) to identify the status of each contact for these two categories:
What I'm trying to do here is create a new column (or measure if that makes more sense) that tells me when a contact is BOTH a competitor and an alumni. I've tried IF statements, SWITCH/TRUE() statements, calculated tables...it's all failed me. I'm not sure if it's a mistake at this stage, or if I messed up by creating the two SWITCH columns first. You'll notice in the data model screenshot that the Alumni and Competitor tables do not have an active relationship, ruling out RELATED and similar functions.
I'm completely stuck...open to ideas, and can add more info on the data model if needed. Thanks in advance!
Solved! Go to Solution.
@ValtteriN It turns out I was getting too cute with my DAX code. Solved my problem with this:
Now it's working as it should:
Thank you for the time and insight!
@ValtteriNI tried your method and here is what it gave me:
That's the code...here is the full error message:
Here is what my calculated columns look like (both CompetitorSwitch and AlumniSwitch are set up the same):
Hi,
This error can usually be resolved by using MAX() arounf your columns. E.g.
Proud to be a Super User!
@ValtteriN It turns out I was getting too cute with my DAX code. Solved my problem with this:
Now it's working as it should:
Thank you for the time and insight!
Hi,
Might I inquire how your IF and SWITCH tries failed? The basic formula for two IF conditions is as follows:
If this pattern doesn't work ping me with @
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |