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
Omega
Impactful Individual
Impactful Individual

Absolute at total

Dears,

 

I am currently trying to calculate the absolute difference between imports and exports at SKU level in the total. For the same SKU, I have imports and exports in every week. At the end of week 8, I'd like to check the absolute difference between Imports and Exports. How?

 

Power BI_2.PNG

1 ACCEPTED SOLUTION

@Omega,

Create the following measures and check if you get expected result.

NewMeasure = IF(COUNTROWS(VALUES(Table2[SKU]))=1,Table2[ABSDIFF],SUMX(VALUES(Table2[SKU]),[ABSDIFF]))
Measure 3 = [NewMeasure]/[ExportTotal]

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

24 REPLIES 24

what is your actual requriement here?   

 

you want to divide it into some of the skus but not all?

 

can you tell me what your end goal is, ie the business requirement





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Omega
Impactful Individual
Impactful Individual

Requirement: Calculate Abs(Export - Import)/Export at SKU level, week level and month level assuming month level have been already defined based on the weeks. 

 

We have many SKUs and it's impossible to filter them. We need a general measure that does the calculation regardless of the numbers of SKUs. 

 

Thanks!

alright i am just trying to understand the problem

 

do you want all the sku's or just certain sku's, so what i am saying how will power bi know what sku's to use?  is there an indicator that is applied to them. the ones you need to use. what is the condition that will include them in the calculation





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Omega
Impactful Individual
Impactful Individual

It should be all SKUs. 

 

Imagine in excel::

 

You have a list of SKUs that have exports and imports in different weeks (Same as the one I shared in my first post but with multiple SKUs). You will create a column that will get you the absolute difference for each SKU which is the measure we have created earlier. At the end, you will sum up the exports and the absolute diffenence for all SKUs and then you will will divide the summation of absolute difference to the total exports to get a percantage. This percentage will be at SKU level. 

 

So in my example, 470/8510 = 5% for that SKU.

 

I hope I'm clear.  

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.