March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I need some assistance to write a formula to compare two columns in different tables in Power BI
Solved! Go to Solution.
Hi @Pooja_Mishra ,
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
Proud to be a Super User!
Hi @Pooja_Mishra ,
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
Proud to be a Super User!
Hi @Nathaniel_C ,
Thanks for your help. I got my resolution, but this query also works:
It resolved my query. Thanks for your help again!!!
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!
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
Hi @Pooja_Mishra , 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
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |