Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
This should be simple, but I'm having a mental block. I want to sum sales in the transaction table where the COUNT_ME field in the billing_Data table is equal to "Y" . Both tables have the CLIENT_ID and DATE field, but aren't directly joined.
Thanks in advance for any help.
Thank you for the quick response!
I've been playing with your suggestion for the past hour plus and the result is still the entire sum of sales, not the filtered subset of sales. I an only looking to sum sales in the transaction table where the coresponding records from the Billing_Data table based on DATE and Client_ID where COUNT_ME = "Y"
I'm not sure why I can't figure this out, it should be easy!
Any other suggestions are greatly appreciated.
Thank you
Hi @Joe_U ,
Here I create a sample to have a test.
Billing_Data:
Transactions:
Data model:
Measure:
Sum Sales of Y =
VAR _ADD =
ADDCOLUMNS (
Transactions,
"Count_Me",
CALCULATE (
MAX ( Billing_Data[COUNT_ME] ),
FILTER (
Billing_Data,
Billing_Data[CLIENT_ID] = EARLIER ( [CLIENT_ID] )
&& Billing_Data[DATE] = EARLIER ( [DATE] )
)
)
)
RETURN
SUMX ( FILTER ( _ADD, [Count_Me] = "Y" ), [Sales] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Rico, giving a try now!
try something like:
Measure =
var clientsFiltered = SELECTCOLUMNS(FILTER(Billing_data, Billing_data[COUNT_ME] = "Y"), "ClientID", Billing_data[Client_ID])
var transactions = CALCULATE(COUNT(Transactions[Client_ID]), TREATAS(clientsFiltered, Transactions[Client_ID]))
return transactions
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 21 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 59 | |
| 53 | |
| 41 | |
| 31 | |
| 31 |