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.
Hi,
I have two table (alot more but ill use two).
In my ad details table 'addetails' I have a column called 'adqinstr' in there I have mulitple rows with either "Private", "Trade", or "Bus Acc".
In my customer table 'custAcc' I have created a cacluated column where i want to say if find "Buss Acc" then set it to "BA" else put "normal".
None of the DAX functions seem to be available (no list appears) and the useful columns only seem to show the columns for that table.
Thanks
Solved! Go to Solution.
@Anonymous
According to the table relationship shortcut you provided above, there is a One to Many relationship between table "custAcc" ant table "adDetails", and table "custAcc" is on the one side of the relationship. In this scenario, you should use RELATEDTABLE function to create the calculated column for table "custAcc".
The formula below is for your reference.
Column = IF ( CONTAINS ( RELATEDTABLE ( adDetails ), adDetails[adqinstr], "Bus Acc" ), "BA", "Normal" )
Regards
@Anonymous
According to the table relationship shortcut you provided above, there is a One to Many relationship between table "custAcc" ant table "adDetails", and table "custAcc" is on the one side of the relationship. In this scenario, you should use RELATEDTABLE function to create the calculated column for table "custAcc".
The formula below is for your reference.
Column = IF ( CONTAINS ( RELATEDTABLE ( adDetails ), adDetails[adqinstr], "Bus Acc" ), "BA", "Normal" )
Regards
Hi There,
You can create the conditional column in Query mode.
Thanks & Regards,
Bhavesh
Hi Bhavesh,
I have tried but it does not seem to give me the option to reference the other table.
Thanks
Sort of like
Column = If(Related('adDetails'[adqinstr])="Bus Acc","BA","Normal")
But it doesnt work
Can you please share your data model?
Thanks
Bhavesh
Hi There,
Instead of relying on calculated column, why don't you try merging both the tables and It can give you desire results.
Thanks & Regards,
Bhavesh
Hi Pacesh I wanting to keep them seperate to maintain integrity,
Please find attached my data model
@Anonymous
Since your data model appears to have relationships all over, can't you instead use DAX to make your calculated column instead of Power Query (M)?
To make a DAX calculated column right click the table you want to create the column in and click "New Calculated Column"
Hi Wonga,
Ive tried to use
Column = If(Related('adDetails'[adqinstr])="Bus Acc","BA","Normal")
But it does not seem to like it ....struggling with the DAX.
Thanks
@Anonymous When you say it doesn't seem to like it, can you expand on that? What is the exact error message?
The column 'adDetails[adqinstr]' either doesn't exist or doesn't have a relationship to any table available in the current context.
The column 'adDetails[adqinstr]' either doesn't exist or doesn't have a relationship to any table available in the current context.
The column 'adDetails[adqinstr]' either doesn't exist or doesn't have a relationship to any table available in the current context.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |