Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
21 | |
21 | |
19 | |
13 | |
12 |
User | Count |
---|---|
42 | |
28 | |
23 | |
22 | |
22 |