The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |