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

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.

Reply
novicenovice
Helper I
Helper I

DISTINCT COUNT - ISSUE WITH FILTERS

Dear all,

 

I have 2 Tables [Customer] and [Sales] and I try to count how many customer do we lost with the conditions below :

 

Customers which ordered between 2016-10-01[A] to 2017-09-30[C] and for those what was the sales between 2017-07-01[B] to 2017-09-30[C].

 

I try this formula in dax but it returns blank. 

 

Relation is done between Customer and sales on the fields [CUST]

 

 

VAR IDRESULT = CALCULATE(DISTINCTCOUNT(Customer[CUST]);FILTER(Customer;Customer[LAST SALES]>=[A]&&Customer[LAST SALES]<=[C]);FILTER(Sales;Sales[Period_date]>=[B]&&Sales[Period_date]<=[C]))

 

Thanks for the one who can help.

 

Novice

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @novicenovice,

 

You can not filter the result between two tables directly. You could create relationship between two tables and create a calcultted column using the RELATED function. Kindly share your sample data to me so that I can help with that. You can upload your file to dorpbox and share the link here.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @novicenovice,

 

Has your issue been solved? If any other question, feel free to let me know please.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.