Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Total of measure is incorrect

Hello, I am trying to get a "total of cost variance". At row level I get the correct cost variation but the total does not add up. I refered to couple of other post with similar issue but my case is different since my measure has a combination of average and substraction. I have pasted the data table here. Also, in 2nd table, the highlightes area is where the issue is. I am using following to DAX calculations. FIrst one to get just average variance per truck and 2nd to create master meaure column to use in my view.

 

Extra TL Cost = Calculate(AVERAGE('PTA'[FreightCost]),FILTER(ALL('PTA'[Executed Mode]),PTA[Executed Mode]="TL"))-Calculate(AVERAGE(PTA[FreightCost]),FILTER(ALL(PTA[Executed Mode]),PTA[Executed Mode]="IM"))
 
Total TL Variance = if(HASONEFILTER(PTA[Lane]),Calculate(DISTINCTCOUNT(PTA[LOADNUM]),filter(ALL(PTA[Executed Mode]),'PTA'[Executed Mode]="TL"))*[Extra TL Cost],sumx(PTA,[Extra TL Cost]))
 

Capture.PNG Capture1.PNG

 
1 ACCEPTED SOLUTION
rajulshah
Super User
Super User

Hello @Anonymous,

You can try using the following measure to plot in the matrix:

Total Measure = SUMX(SUMMARIZE(PTA,PTA[Lane]),[Total TL Variance])

Hope this helps. 

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use ISINSCOPE() function to set the value of total row.

Could you please share your sample data and excepted result to me if you don't have any confidential information. Please upload your files to One Drive and share the link here.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

 If possible please share a sample pbix file after removing sensitive information.

 

You are using distinctcount in one formula and distinct count at GT level might not sum of the line level. so can show diff.

 

Thanks


Read and like My Recent Blog -

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

rajulshah
Super User
Super User

Hello @Anonymous,

You can try using the following measure to plot in the matrix:

Total Measure = SUMX(SUMMARIZE(PTA,PTA[Lane]),[Total TL Variance])

Hope this helps. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.