Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have 2 tables with the same measures, but producing different time periods - historical and current. So I need something like this for one of the measures:
Case when Table A[Type]=N/A and Table B[Type]<>N/A then Table B
Hi @Tihannah ,
Sorry, but I'm a little confused by your description. It seems like you used 'Append' rather than 'Merge'. Please take a look at the link to understand the difference bewteen these two actions.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Thank you for sending the pbix file. I did perform a merge and selected the following columns, but I did not get the same output as you. I merged on the following columns:
Customer ID
Location ID
Date
But when I looked, this did not look the same as mine:
= Table.NestedJoin(#"Table A", {"Emp"}, #"Table B", {"Emp"}, "Table B", JoinKind.LeftOuter)
So I have made the corrections and it is loading so we will see what happens. Thanks.
Hi @Tihannah ,
When you have one or more columns that you’d like to add to another query, you merge the queries.
You could take a look at this document for further information.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
The merge gave me one "type" column in the table. In your DAX, you have the Types distinguished as Table A and Table B. You also have both var ="N/A" when I need Table A=N/A and Table B<>N/A?
I'm not understanding how this merge separates the two.
Hi @Tihannah ,
According to my understand, you want to display Type based on value from two tables, right?
You could merge the two tables, then use the following formula:
flag =
VAR flagA =
IF ( MAX ( 'Merge1'[Table A.Type] ) = "N/A", 1, 0 )
VAR flagB =
IF ( MAX ( 'Merge1'[Table B.Type] ) = "N/A", 1, 0 )
RETURN
IF ( flagA = 1 && flagB = 0, MAX ( 'Merge1'[Table B.Type] ), BLANK () )
My visualization looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Okay, wasn't familiar with the merge, but found it and performed the merge on the two tables, but I'm not understanding how the 2 table A.type and table B.type are both brought into the merge table? It's bringing in all like columns as one?
Yes, this is what I'm trying to achieve, but the DAX 'merge1' part returned a syntax error. When I removed the 'Merge1', it only returned blanks.
Here is a sample.
@Tihannah , Ask is not very clear
there are way to copy data from one table to another
// work both 1-M and M-1
City Name = maxx(FILTER(geography,geography[City Id]=Sales[City Id]),geography[City]) //Agg you can change
//1 -M with active relation
Item Name = RELATED('item'[Brand])
//1 to M
Month Name = LOOKUPVALUE('date'[Month Year],'date'[Date],Sales[Sales Date])
Sorry, a bit confused. Not trying to copy data from another table. In both tables, I have the same list of people in the same category segments based on their activity during different time periods and they are rolled up into these categories. So Im basically saying, if these people were Non-Active in Table A and Active in Table B, give me their Activity segment from Table B. Does that make more sense? Column names are the same in both tables.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
73 | |
65 |