Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am using three data tables:
1) sales by account 2) account and 3) calls.
I have created a formula for a distinct count on # of accounts based on a filter for being a target account:
# of Target Accounts = calculate(DISTINCTCOUNT(Account[Id]),Account[Target Flag]="Yes")
Then I have created a formula for the value of the target accounts:
Solved! Go to Solution.
Hi @Dlahey
Here's a measure that builds a list of reached accounts first.
We can then use that to filter a calculation very similar to your Value of Target Accounts measure
Value of Target Account Reach =
VAR _ReachedAccounts = VALUES('Call'[Account])
VAR _Result =
CALCULATE(
SUM(Sales_Data[Total Sales]),
Account[Target Flag]="Yes",
Account[Id] IN (_ReachedAccounts)
)
RETURN
_Result
if you prefer, you could make the code DRY by referencing your Value of Target Accounts measure instead
Value of Target Account Reach =
VAR _CalledAccounts = VALUES('Call'[Account])
VAR _Result =
CALCULATE(
[Value of Target Accounts],
Account[Id] IN (_CalledAccounts)
)
RETURN
_Result
both these options give the same result.
Hi @Dlahey
Here's a measure that builds a list of reached accounts first.
We can then use that to filter a calculation very similar to your Value of Target Accounts measure
Value of Target Account Reach =
VAR _ReachedAccounts = VALUES('Call'[Account])
VAR _Result =
CALCULATE(
SUM(Sales_Data[Total Sales]),
Account[Target Flag]="Yes",
Account[Id] IN (_ReachedAccounts)
)
RETURN
_Result
if you prefer, you could make the code DRY by referencing your Value of Target Accounts measure instead
Value of Target Account Reach =
VAR _CalledAccounts = VALUES('Call'[Account])
VAR _Result =
CALCULATE(
[Value of Target Accounts],
Account[Id] IN (_CalledAccounts)
)
RETURN
_Result
both these options give the same result.
you just made my life sooo much easier - thank you so so much!!!!
Hi @Dlahey ,
Try thi out:
Value of Target Account Reach = IF(AND(Account[Target Flag]="Yes", distinctcount('Call'[Account])>1), sum(Sales_Data[Total Sales]))
Mark this as a solution, if I answered your question. Kudos are always appreciated.
Thanks!
Hi,
Thanks so much for your help! Unfortunately, this is not working - see below error:
a few variable names are slightly different but aligned to the above example
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
20 | |
18 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |