Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
72 | |
65 | |
42 | |
28 | |
21 |