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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
broodstar
Regular Visitor

Distinctcount crashing my PC

Dear Dax users I need help or I go crazy,

 

I have two tables in data model - Data, Customers 

 

Data

 

 

 

Customer

Month

Product

KR

1019593

2020/06

Product A

10

1019593

2020/06

PRoduct B

2

...

...

...

...

 

Customers

 

 

 

Customer

Selected month

Countrows

Distinct count month

1019593

2020/06

2

crashing PC

...

...

...

...

 

I want to know number of months in which any product was sold. I cannot use countrows, becuase it returns 2 as there are two products sold in one month.

= CALCULATE

(

  Countrows(Data);

   FILTER(Data; Data[Customer] = Customers[Customer]);

   FILTER(Data; Data[Month] = Customers[Selected month])

)

 

 

I guess I need to use distinct count, but if I put the formula below, the pc crashes. Do you where could be the problem? Please?

 

= CALCULATE

(

  DISTINCTCOUNT(Data[Month]);

   FILTER(Data; Data[Customer] = Customers[Customer]);

   FILTER(Data; Data[Month] = Customers[Selected month])

)

1 REPLY 1
kentyler
Solution Sage
Solution Sage

Have you tried restarting your PC and reinstalling Power BI ? You might also try install DAX Studio...which will give you better insights about what queries are actually being run.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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