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.
First, I have to say, this user community is AWESOME! Everyone is so professional in the way they handle questions and responses that I do not see in other user groups.
Now, I have a report I am building that has a query pulling information from our IBM DB2 system and a table that I created. Each of these have a PALLET_LOC field. I have a relationship between these based on the PALLET_LOC field and the table has a LocationTag field (value: Exclude) that gets returned to my report. My issue is that if the PALLET_LOC is in the exclude table, then is putting Exclude out in the report, but I need to have it output Include if the PALLET_LOC is not in the table. I am used to other languages if/else statements to do this, but PB is causing me issues. I know I could do a Conditional Column and have each location in the if/else statement, but it would be easier to maintain if I had only had to add a value to the table to update the report.
Solved! Go to Solution.
if the relationship between warehouse table and location table is many to one
you can try this
Column = if( RELATED(PalletLocation[LOC_TAG])="","Include",RELATED(PalletLocation[PALLET_LOC]))
pls see the attachment below
Proud to be a Super User!
@Stachu Thank you. I wasn't sure what information you might need. Here are the 2 tables in question. I am doing a one-to-many relationship on these.
qryWarehousePallet
ORD_NUM | SKU | PALLET_LOC | LOC_TAG |
246 | ABC9 | Q6PLT | EXCLUDE |
998 | EED | H107A | INCLUDE |
tblPalletLocation
PALLET_LOC | LOC_TAG |
Q6PLT | Exclude |
LOCQ6 | Exclude |
Q601A | Exclude |
FLOOR | Exclude |
MIA01 | Exclude |
what's the expected output based on your sample data?
Proud to be a Super User!
Based on the sample data, if qryWarehousePallet.PALLET_LOC is in tblPalletLocation.PALLET_LOC, then it returns tblPalletLocation.LOC_TAG, which would be Exclude, else it returns the word Include.
if the relationship between warehouse table and location table is many to one
you can try this
Column = if( RELATED(PalletLocation[LOC_TAG])="","Include",RELATED(PalletLocation[PALLET_LOC]))
pls see the attachment below
Proud to be a Super User!
you are welcome
Proud to be a Super User!
Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).
Column1 | Column2 |
A | 1 |
B | 2.5 |
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |