Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |