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.
I made the previous table just for example.
I have a column name "Month Contract Broken" and I wanna know how much contracts was in each month, for this, I made a simple DISTINCTCOUNT(sale_id) and it is the first column and its nice.
Now, for the column "Expect Result" I made a simple CALCULATE(DISTINCTCOUNT(sales[sale_id]); ALL(sales_instal['Month Contract Broken'])) but it not returns the expect result, returns the same value as "Simple Count".
I don't know where is the problem, I have a lot of tables on my data model and a lot of columns, someone knows what can cause it?
Month Contract Broken is on a table named "sales_instal" and "sale_id" was on a table named "sales"
Solved! Go to Solution.
Finally, I can solve my problem. After tests and tests I realize that my problem was in "Classify Column".
The column "Month Contract Broken" was classified by another column (Because "1st month", "2nd month" was texts and Power BI ordenate in the following order: 1st month, 10th month, 11th month) and believe it, I need to put on my SIMPLE measure the ALL of column that I used to classify.
Measre Solved = CALCULATE(DISTINCTCOUNT(sales['sale_id']); ALL(sales_instal['Month Contract Broken']; sales_instal['Class_MonthContractBroken']))
And I can say, I don't have the column "Class_MonthContractBroken" on my visual table, just the column "Month Contract Broken" and my measure.
Hey Microsoft, this behavior is expected?
Finally, I can solve my problem. After tests and tests I realize that my problem was in "Classify Column".
The column "Month Contract Broken" was classified by another column (Because "1st month", "2nd month" was texts and Power BI ordenate in the following order: 1st month, 10th month, 11th month) and believe it, I need to put on my SIMPLE measure the ALL of column that I used to classify.
Measre Solved = CALCULATE(DISTINCTCOUNT(sales['sale_id']); ALL(sales_instal['Month Contract Broken']; sales_instal['Class_MonthContractBroken']))
And I can say, I don't have the column "Class_MonthContractBroken" on my visual table, just the column "Month Contract Broken" and my measure.
Hey Microsoft, this behavior is expected?
Hi @gluizqueiroz ,
You could try ALL(sales).
Your visuals only show the fields you select. If you need it, you could add it to your visual. "Class_MonthContractBroken" belongs to sales_instal, I think these two tables have a relationship and you could use it in your DAX directly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |