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.
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])
)
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.
Help when you know. Ask when you don't!
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |