Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have two tables
table 1
product_name | ID |
abc | 123 |
abc | 789 |
table 2
product_name | ID |
abc | 789 |
report layout
Filter table 2 ID values based on table 1 Id values
business qn: I want to know how many of them downloaded the trial product and out of those how many purchased. Left side trials, right side purchases. Table_1 is trial download data table_2 is purchase data
PS: columns are not unique
Solved! Go to Solution.
Hi, @Anonymous
It’s my pleasure to answer for you.
According to your description,I think create two measure in card to calculate the desired result.
Like this:
count1 = COUNTROWS(Table1)
count2 = COUNTROWS(INTERSECT(Table2,Table1))
Here is my sample .pbix file.Hope it helps.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
If there are more than two columns in the table.
You can try this:
count2 =
COUNTROWS (
INTERSECT (
SELECTCOLUMNS ( Table2, "name", [product_name], "id", [ID] ),
SELECTCOLUMNS ( Table1, "name", [product_name], "id", [ID] )
)
)
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
It’s my pleasure to answer for you.
According to your description,I think create two measure in card to calculate the desired result.
Like this:
count1 = COUNTROWS(Table1)
count2 = COUNTROWS(INTERSECT(Table2,Table1))
Here is my sample .pbix file.Hope it helps.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
If there are more than two columns in the table.
You can try this:
count2 =
COUNTROWS (
INTERSECT (
SELECTCOLUMNS ( Table2, "name", [product_name], "id", [ID] ),
SELECTCOLUMNS ( Table1, "name", [product_name], "id", [ID] )
)
)
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
For maximum flexibility you'll want to let the data model do the work for you. Meaning you would need to define some sort of relationship between the tables, and then decide on the filter direction (which table impacts the other). This works ok-ish even if the values are not unique in the "dimension" table but it would works better if you had a Products reference table that has unique values.
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
16 | |
11 | |
5 | |
4 | |
3 |