0

I am creating a measure, Measure = divide(sum(amount),count(task)), this is giving me incorrect total.

This is what I am getting in Power BI.

Table

Now the result which is expected here is

Desired Result

Basically what I want is to get the total of the measure that I have created, Power BI is dividing the total sum with the total count.

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64
  • Related: [Distinct Count Incorrect Total](https://stackoverflow.com/questions/54153766/power-bi-distinct-count-incorrect-total/54154526) and [DAX Average Issue](https://stackoverflow.com/questions/49150526/dax-average-issue/49156948) – Alexis Olson Mar 19 '19 at 15:19
  • Can you explain your "correct total"? It makes no sense. How is it different from "Amount"? – RADO Mar 20 '19 at 06:29
  • Column Amount is a backend value and Column correct total is sum(total)/count(task), So if you see in the screen shot all the task has only one value, so the count will be 1. – Abhishek Pandey Mar 20 '19 at 09:33
  • In such case, Power BI total is correct. Why do you think it's wrong? – RADO Mar 20 '19 at 16:19
  • Yes, as per functionality of the expression that i have written, it is correct, but the requirement is slightly different. I want to sum up the result which i am getting from sum(amount)/count(task) – Abhishek Pandey Mar 21 '19 at 03:56
  • Is their any solution for this – Abhishek Pandey Mar 22 '19 at 01:26

1 Answers1

0

The answer could be quite mundane. Instead of the Measure = divide(sum(amount),count(task)) you may instead be wanting to use:

Measure = SUM(amount)

The divide(sum(amount),count(task)) measure is a longhanded way of calculating the mean (AVERAGE being the shorthand way). But what you seem to require is the SUM.

oshah81
  • 93
  • 4
  • Yes, i want to sum, but i want to sum up the values of the measure, what i am getting in Power BI is, it is dividing the total sum with count. if you see the second screenshot above, the column correct total is the expected result and the column wrong total is something that i am getting in Power BI. Do i need to change something in DAX – Abhishek Pandey Mar 20 '19 at 05:34
  • Is their any solution for this? – Abhishek Pandey Mar 22 '19 at 09:00
  • It's no longer clear whether you want the "correct total" to be the sum of the measure or the sum of the measure divided by the count of tasks, or something else. If you wanted the sum of the measure, change the Measure's DAX to my formula. If you wanted the sum divided by the count of tasks, then as @rado explains above, what you call the "Wrong total" is actually the right total. If you wanted something else, we would need to know more about where you're pulling the data from. – oshah81 Mar 22 '19 at 15:49