cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Issue with Totals

Hi team, this is the issue I am having
 
Here below is my query
 
km/stop =
VAR AVGKMS = AVERAGE(E3table_1[KM])
return
if(hasonevalue(E3table_1[ManInd]),AVGKMS,SUMX(VALUES(E3table_1[ManInd]),AVGKMS))
 
the output I am getting is 
 
Total Manifest = 4
Avg Km/shift = 320.86
Count = 43
Total Avg KM/Shift (AVGKMS)- 1,283.43
 
sorry I cannot print screen as it is too small.  
 
Below is what I want to see (This below is when I did this on excel)
As you can see below 
my 4 rows on manifest is correct as above
my total counts of 43 is also correct, 
my average of KMS is also correct.
 
 
 
Row LabelsAverage of KMCount of Stops
4583383350.8361211
4623383408.772369
4633383347.6174410
4643383214.0422213
Grand Total320.857484243
sum 4 avg kms1321.26814 
sum divided by count30.72716605 
 

 

The discrepancy is that when i run above dax formula I want the sum to be 1321.268 as below, but it is coming to 1,283.43, and I have no idea where I am getting that from.  can anyone help? 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@salman_ali these will be two different measures , one Avg Kms Measure and 2nd will be Measure1

 

AVG Kms Measure = AVERAGE(E3table_1[KM])

Measure1 = 
IF ( HASONEVALUE(E3table_1[ManInd]),
[AVG Kms Measure],
SUMX(
SUMMARIZE ( VALUES(E3table_1[ManInd]), E3table_1[ManInd], "AvgKms",[AVG Kms Measure] ),
[AvgKms]
)
)

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Hi,

Do these measures work?

AVGKMS = AVERAGE(E3table_1[KM])

Measure1 = if(hasonevalue(E3table_1[ManInd]),AVGKMS,SUMX(SUMMARIZE(VALUES(E3table_1[ManInd]),E3table_1[ManInd],"ABCD",[AVGKMS]),[ABCD]))

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted

Sorry Ashish, this is giving me error 

Highlighted

Hi,

Does this work?

AVGKMS = AVERAGE(E3table_1[KM])

Measure1 = if(hasonevalue(E3table_1[ManInd]),[AVGKMS],SUMX(SUMMARIZE(VALUES(E3table_1[ManInd]),E3table_1[ManInd],"ABCD",[AVGKMS]),[ABCD]))

If it does not, then share the link from where i can download the PBI file and clearly show the visual where my measure is not working.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted

sorry unfortunately i cannot share the file but the error comes when i type Measure1 =.

does there need to be a something after 

AVGKMS = AVERAGE(E3table_1[KM]) to connect the two lines?
Highlighted

Hi,

Sorry but i cannot help if you cannot share any data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted

i understand, thank you 

Highlighted

@salman_ali these will be two different measures , one Avg Kms Measure and 2nd will be Measure1

 

AVG Kms Measure = AVERAGE(E3table_1[KM])

Measure1 = 
IF ( HASONEVALUE(E3table_1[ManInd]),
[AVG Kms Measure],
SUMX(
SUMMARIZE ( VALUES(E3table_1[ManInd]), E3table_1[ManInd], "AvgKms",[AVG Kms Measure] ),
[AvgKms]
)
)

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Highlighted
Community Support
Community Support

Hi @salman_ali ,

 

You can copy and past your sample data here directly. Could you plz share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive for Business and share the link here.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Highlighted

Thank you, this worked 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors