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
I feel this is an easy one but I can't figure it out.
I have two Tables, both with column Name. Table 1 has a full data set of names which can repeate, Table 2 has a subset of names which can repeat and are not all inclusive of the names in Table 1
Table 1 |
Name |
John |
John |
John |
Amanda |
Peter |
Kristin |
Kristin |
Sam |
Table 2 |
Name |
John |
Sam |
Kristn |
Kristin |
Amanda |
I have some charts with Table1 'Name' across the X axis and I would like to show the percentage of counts of the name appears in Table 2 compared to the full data set in Table 1
for example, in my small example here, John would appear on the X-Axis first and the line would be 1/3=33%; Amanda would be next and would be 1/1=100%, Peter next and be 0/1=0%
Solved! Go to Solution.
Hi, @cflook00
According to your description, you want to get the number of names appearing in Table2 as a percentage of the number of names appearing in Table1. Right?
Here are the steps you can follow:
(1) My test data is the same as you.The two table don't need to build relationships.
(2)We can click "New measure" to create a measure :
Percentage = DIVIDE(CALCULATE( COUNT('Table2'[Name])+0 , 'Table2'[Name] = SELECTEDVALUE('Table1'[Name])),COUNT(Table1[Name]))
(3)Then we can put the 'Table1'[Name] and the measure in the visual you want and we can meet your need. The result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @cflook00
According to your description, you want to get the number of names appearing in Table2 as a percentage of the number of names appearing in Table1. Right?
Here are the steps you can follow:
(1) My test data is the same as you.The two table don't need to build relationships.
(2)We can click "New measure" to create a measure :
Percentage = DIVIDE(CALCULATE( COUNT('Table2'[Name])+0 , 'Table2'[Name] = SELECTEDVALUE('Table1'[Name])),COUNT(Table1[Name]))
(3)Then we can put the 'Table1'[Name] and the measure in the visual you want and we can meet your need. The result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hey thanks for taking a look at this one for me; unfortunately i can't download anything to my work computer; i think i found a long workaround -- creating a third table with Name, distinct values, then linking Table 1 and Tabl 2 to it, using 'relatedtable' function & using this Table3[name] in the charts --- was hoping it would be as simple as a single dax statement so i wouldn't have to manage a 3rd table;
in my example i created a third table too
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 |
---|---|
25 | |
18 | |
15 | |
9 | |
7 |
User | Count |
---|---|
37 | |
31 | |
16 | |
16 | |
12 |