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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
abhishekrws01
Helper I
Helper I

How to Fix Subtotal

Hello - Looking for some, please. I tried to solve it through various solutions on the PowerBI community/Youtube as most of the time is HASONEVALUE function but I am not able to solve so sharing my problem here. Please help if possible.

 

I am trying to calculate a weighted average of working days. The weighted average is getting calculated correctly, but the subtotals are wrong. Example: For UK & Ireland I am expecting a value of 5 which is 0.18+4.82 but I get 10 which is the sum of the absolute working days. Please suggest the right method if possible.

 

abhishekrws01_0-1685648965357.png

 

Thanks

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

Measure = SUMX(VALUES(Data[Display Country name]),[Current Weighted avg])


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

Hi Ashish, Thank you for the comment. I solved it with some of the research on the web. I used the ISINCOPE function and added the syntax similar to what you suggested.

IF(ISINSCOPE(Region[Display Country Name]),SUMX(vTable,[Weighted WD]) ,SUMX(vTable,Divide([Country Sales], [Total Sales])* [Working days]))

 

Thank you for your time.

Best regards

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.