Forum Discussion
Power BI Desktop
Hi,
I need some assistance to write a formula to compare two columns in different tables in Power BI
Hi Anonymous ,
Do you mean like this?excepttable = except(values('Table2'[Country]),values('Table1'[Country]))This shows those countries in table 2 that are not in table 1.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel
5 Replies
- Nathaniel_CCommunity Champion
Hi Anonymous ,
Do you mean like this?excepttable = except(values('Table2'[Country]),values('Table1'[Country]))This shows those countries in table 2 that are not in table 1.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel- AnonymousNot applicable
Hi Nathaniel_C ,
Thanks for your help. I got my resolution, but this query also works:
excepttable = except(Table2,Table1)I got this as output:It resolved my query. Thanks for your help again!!!
- Nathaniel_CCommunity Champion
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- AnonymousNot applicable
Hi Nathaniel,
Thanks for your response. Here, is the dummy data:
Table 1:
Prefix Country Count A ABC 2 B FHG 4 C KJL 5 D SGH 6 E YUI 4 F KJH 9 Table 2:
Prefix Country Count A ABC 2 B FHG 4 C KJL 5 G BNM 3 D SGH 6 H JKL 8 E YUI 4 F KJH 9 I need to write a formula to compare two columns (Country) from the above 2 tables in Power BI
- Nathaniel_CCommunity Champion
Hi Anonymous , not sure what you mean when you say compare two columns. Do you mean how many more countries are in table 2?
If so, try this:More Countries in T2 compared to T1 = VAR _t1Country = COUNT ( Table1[Country] ) VAR _t2Country = COUNT ( Table2[Country] ) RETURN _t2Country - _t1Country
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel