Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

dax measure to multiply a column from a different table by a distinct count and filter of current t

I have a table of all of my customer transactions and a separate table with my sales quotas. I'm trying to get the formula to:

Distinct count the number of transaction dates in the customer transactions table, where the working day=yes. Then multiply that number of days by the daily quota.

 

I currently have this formula but it is giving me an error

 

Quota =
CALCULATE(
DISTINCTCOUNT('Customer Sales Transactions'[Transaction Date]),
FILTER('Customer Sales Transactions',
'Customer Sales Transactions'[CS Working Day]="Yes")
)
*'Sales Team Quotas'[Daily Quota])

1 ACCEPTED SOLUTION
Floriankx
Solution Sage
Solution Sage

Do you want to create a measure or a calculated column?

At first it seems your last ')' is too much. Maybe this helps.

 

Here an alternative if not.

For Measure you could try:

Quota =
CALCULATE(
COUNTROWS(VALUES('Customer Sales Transactions)),
FILTER('Customer Sales Transactions',
'Customer Sales Transactions'[CS Working Day]="Yes")
)
*Sum('Sales Team Quotas'[Daily Quota])

 

In this case you need to ensure a relation between these tables.

View solution in original post

5 REPLIES 5
Floriankx
Solution Sage
Solution Sage

Do you want to create a measure or a calculated column?

At first it seems your last ')' is too much. Maybe this helps.

 

Here an alternative if not.

For Measure you could try:

Quota =
CALCULATE(
COUNTROWS(VALUES('Customer Sales Transactions)),
FILTER('Customer Sales Transactions',
'Customer Sales Transactions'[CS Working Day]="Yes")
)
*Sum('Sales Team Quotas'[Daily Quota])

 

In this case you need to ensure a relation between these tables.

Anonymous
Not applicable

Your alternative option worked, thank you so much!

 

Can you help me understand how this worked and why the 'Sum' function was used at the end?

 

 

Hello, 

 

you can't reference to a row in a measure so you have to wrap it with SUM, MIN, MAX etc even if there is only one row each relevant value.

 

Best regards.

Anonymous
Not applicable

This solution worked great, however, i have the chart connected to a slicer where i select the month i want to see, but the formula isnt calculating correctly based on the slicer. How do i get it to narrow by the time frame in the slicer?

Do you have a separate DateTable?

 

If not there is your problem. You have to create a DateTable with contigous dates relate the other two tables and slice by the DateTable.

 

If you have several years slicing by month gives you the month value of all available years.

 

Best regards.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors