Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I am working with the below calculated measure that is being used for the values of a matrix in Power BI. The totals associated with this matrix are incorrect and I could use some insight as to how best to address it.
Try this simple fix. Create a measure to handle the "count" portion of the calculate statement, then place in that measure into the code instead. This often fixes the total problem.
Count Orders = 'Orders'[ID]
Orders: Sales - Measure = CALCULATE([Count Orders],FILTER('Orders','Orders'[Metric] = "Ins"))
@aj1973, I probably should have mentioned that I am using a timestamp field along the x-axis of the matrix. Applying your code makes all the months the same number.
@Anonymous
Can you share a sample! it would make it easier for us to help you out
Thanks
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@aj1973 How would you like me to send a sample? I will probably have to orcustrate a sample since the dataset I am using is confidential work material.
Here is a better summary of the situation. I have a matrix that has a geography heirarchy coming from tableA along the y-axis and I have a month-year timestamp field coming from tableB along the x-axis. The values are coming from the measure depectied in this problem of: Orders: Sales - Measure = CALCULATE(COUNTA('Orders'[ID]),FILTER('Orders','Orders'[Metric] = "Ins")). This formula is looking at tableB which depics order related details. The filter on the Metric field is meant to define what order is a sale order (ie "Ins"). I want to count the number of such order, by ununique ID, in that table and bring it into the matrix that shows the result by geography accoss time. TableA & tableB are joined together by the ID field which exist in both. The total row is not matching up to the totals of the individual rows if I were to add them up manually. This is the issue. The total row is incorrect. Hope this helps.
@Anonymous
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@Anonymous
I got your point now, is this what you want to see?
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@aj1973 Very close. Though I want to be able to drill down to months, I am getting 7,557 as what the total (2-month) total should be, not 7,519. I don't want to see "1"s for each row but rather the actual number of IDs found. Does this make sense?
@Anonymous
Here you go
However I don't see how did you get the 7557 count!
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@aj1973 Let me rephrase my 7,557 count. If I manually (calculator or Excel) add up all the rows, I get 7,557, not 7,519. This is the issue. The total should equal the total.
Not sure how you are calculating in excel. COUNTA doesn't count the number of rows in the table. If you want to see 7557 then use COUNTROWS INSTEAD.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Ok before we go any further, you Matrix is some how buggin. You either create a new Matrix or go here
delete that field and re inserted again, the numbers will correct themselves in the Matrix
we talk then.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@aj1973 I am not sure what is buggy about it, but I did what you asked and reuploaded.
Hi @Anonymous
any thoughts towards what? can't recall your issue!
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Hi @Anonymous
Add ALL
CALCULATE(COUNTA('Orders'[ID]),FILTER(ALL('Orders'),'Orders'[Metric] = "Ins"))
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.