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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
brinky
Helper IV
Helper IV

Get volume (multiplication)

Hello,

I'm trying to get the volume sales as follow however I'm getting the wrong values.

I'm using measure 2 to get the sales qty then I'm using measure 4 to get volume however volume values are wrong 🤔 combined sales tables and volume tables are connceted.

Any idea how I can solve such issue? I was trying to get the volume sales with measure 2 using related function but didn't manage.

 

Measure.pngMeasure 4.pngProduct.png

1 ACCEPTED SOLUTION

Hi @brinky ,

 

Try this code.

 

Measure 3 = 
VAR _Invoiced_QTY = 
CALCULATE(SUM(Combined_Sales[Invoiced_QTY_PU]),FILTER(Combined_Sales,Combined_Sales[Return_Reason] in {1,BLANK()}))
VAR _Volumn = CALCULATE(SUM(Volume[Volume]),FILTER(Volume,Volume[CSB_ID_Code] = MAX(Combined_Sales[CSB_ID_Code])))
RETURN
_Invoiced_QTY*_Volumn

 

Result is as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-rzhou-msft
Community Support
Community Support

Hi @brinky ,

 

I think your [Measure 4] is based on [Measure 2] and related

I create a sample to have a test.

CombinedSales:

1.png

VolumTable_1:

2.png

I created a relationship between two tables by Category.

1.png

Measures are the same, it works well.

1.png

Firstly, please check whether [Measure 2] is correct.  You can add a calculated column by related function to get data from [Litres] in CombinedSales.

C_Litries = RELATED(VolumTable_1[Litres])

Or create a measure.

C_Litries = calculated(sum(VolumTable_1[Litres]),Filter(VolumTable_1,VolumTable_1[...] = max(CombinedSales[...])))

 And check whether [Litres]  part is correct.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-rzhou-msft

Thanks for your reply & sample data.


I have these 2 tables connected with Code (attached), what I am after is;


if Return_Reason is 1 or blank Sum the Invoiced_QTY and multiple with Volume from the Volume table

 

https://brincats-my.sharepoint.com/:u:/p/info/Ecge6-_iy4tAlP-1s9c1bZ0B2shp7N1JYpi4YFCogiN-Dg?e=3RdGg...

Hi @brinky ,

 

Try this code.

 

Measure 3 = 
VAR _Invoiced_QTY = 
CALCULATE(SUM(Combined_Sales[Invoiced_QTY_PU]),FILTER(Combined_Sales,Combined_Sales[Return_Reason] in {1,BLANK()}))
VAR _Volumn = CALCULATE(SUM(Volume[Volume]),FILTER(Volume,Volume[CSB_ID_Code] = MAX(Combined_Sales[CSB_ID_Code])))
RETURN
_Invoiced_QTY*_Volumn

 

Result is as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bcdobbs
Super User
Super User

Hi @brinky,

It's not clear from the detail so far how your volume table comes into play as everything just references combined sales. Are you able to share a demo pbix with your structure and some data? Alternatively some dummy data from each table?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Hi @bcdobbs 
Sorry loaded the wrong measure I have updeted my post.

 

Thanks

Could you provide some sample data from the two tables, an image of the relationship between them and a few correct values for the calculation.

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.