Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I want to add a new column to my data marked "yes" or "no".
I have "table 1" with all the data and I have a second "table 2" imported to the data model with a selected customer list (ID) and cost type (Type).
Same as vlookup excel but with two conditions. The first is ID and the second is type.
So to add the column of selected customers to "table 1" with "table 2" marked "yes" or "no"
Please help
Solved! Go to Solution.
Hi @sgintowt,
You may try this Measure.
IsYes Or IsNo =
VAR RelatedType =
CALCULATE (
SELECTEDVALUE ( Table2[Type] ),
FILTER ( Table1, Table1[ID] IN VALUES ( Table2[ID] ) )
)
RETURN
IF ( MAX ( Table1[Type] ) = RelatedType, "Yes", "No" )
Then, the result will look like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how your tables look like, the relationships you create for them and how you create these two count measures. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @sgintowt,
You may try this Measure.
IsYes Or IsNo =
VAR RelatedType =
CALCULATE (
SELECTEDVALUE ( Table2[Type] ),
FILTER ( Table1, Table1[ID] IN VALUES ( Table2[ID] ) )
)
RETURN
IF ( MAX ( Table1[Type] ) = RelatedType, "Yes", "No" )
Then, the result will look like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how your tables look like, the relationships you create for them and how you create these two count measures. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Table 1
ID | UserId | Data | PriceType | Type | Netto | Tax | Brutto | Yes or NO |
6889973 | 71 | 24.11.2021 | netto | FK technologia | 62,84 | 0 | 62,84 | |
6890320 | 71 | 26.11.2021 | netto | FK technologia | 124,8 | 0 | 124,8 | |
6889026 | 71 | 24.11.2021 | netto | FK technologia | 460,82 | 0 | 460,82 | |
6887224 | 1999 | 26.11.2021 | netto | FK Remont | 127,5 | 0 | 127,5 | |
6890130 | 71 | 26.11.2021 | netto | FK Remont | 22749 | 5232,27 | 27981,27 | |
3882058 | 71 | 26.11.2021 | netto | FK Remont | 90 | 20,7 | 110,7 | |
6890379 | 1999 | 24.11.2021 | netto | FK Remont | 2682,11 | 616,89 | 3299 | |
3883647 | 1999 | 26.11.2021 | netto | FK Remont | 474,32 | 109,09 | 583,41 | |
6890151 | 1999 | 26.11.2021 | netto | FK technologia | 13,19 | 3,03 | 16,22 | |
6890151 | 1999 | 26.11.2021 | netto | FK technologia | 32,44 | 1,62 | 34,06 | |
6887224 | 71 | 26.11.2021 | netto | FK technologia | 501,69 | 0 | 501,69 | |
6889814 | 71 | 24.11.2021 | netto | FK koszty | 17 | 0 | 17 | |
6887871 | 71 | 24.11.2021 | netto | FK koszty | 200 | 0 | 200 | |
6889814 | 71 | 24.11.2021 | netto | FK koszty | 17 | 0 | 17 | |
6887224 | 1999 | 26.11.2021 | netto | FK koszty | 141,33 | 0 | 141,33 |
Table 2
ID | Type |
6889973 | FK technologia |
6890320 | FK Remont |
6889026 | FK technologia |
6887224 | FK Remont |
6890130 | FK technologia |
3882058 | FK Remont |
I added sample data.
I need to add the "yes or no" column to table 1 with clients who meet the "ID" and Type "conditions
Hi @sgintowt ,
Can you provide us with your pbix?
If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you.
Please read this post to get your question answered more quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Nathaniel
Proud to be a Super User!
User | Count |
---|---|
44 | |
26 | |
21 | |
17 | |
15 |
User | Count |
---|---|
54 | |
35 | |
18 | |
17 | |
15 |