Forum Discussion
Create calculated column from a calculation in a different table
Hi!
I have a table (Table 1) with organisations and another table (Table 2) with users per organisation and whether they are claimin or not.
I want to add a calculated column in Table 1 (in blue below) to show the number of users claiming for each organisation (coming from Table 2). The common field in both tables is the organisation id.
How can I do this please? Thanks
| Table 1 | |
| Organisation | Users Claiming |
| A | 1 |
| B | 2 |
| Table 2 | ||
| User | Organisation | UserClaiming Y/N |
| x | A | y |
| y | A | n |
| z | B | y |
| h | B | y |
- Anonymous6 years ago
Hi mq2020 ,
Please try to create the following measure to get the flag of every organization with claim:
Org Claiming YN = VAR sumofClaimU = CALCULATE ( DISTINCTCOUNT ( 'User'[User] ), 'User'[User Claimed Y/N] = "y" ) RETURN IF ( sumofClaimU > 0, "Y", "N" )Best Regards
Rena
9 Replies
- mq2020Helper III
Hi!
I do have a relationship of 1 to Many.
What I am trying to do is display a line chart with av.sales for 2 groups (Organisations with users claiming vs Organisations with users not claiming).
The sales are in a 3rd table with has a relationship of Many to 1 with Table 1 (Organisations) so I end up with:
Sales (Many to 1) -> Organisations (1 to Many) -> Users
When i put together info from the sales table and the Users table it is not working, hence, I figured, it may be easier if i add the column I need in the Organisations table (i.e if that organisation has any user claiming)
Thanks,
- AnonymousNot applicable
Hi mq2020 ,
Could you please provide some sample data in table "Sales"(exclude sensitive data)? What's your expected result? What you want is to get the average of sales? If yes, then whether it need to calculate based on certain conditions?
What I am trying to do is display a line chart with av.sales for 2 groups (Organisations with users claiming vs Organisations with users not claiming).
Best Regards
Rena