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
Anonymous
Not applicable

Dax distribute positive number

hello,

 

Im trying to create a dax measure to check if a product  that has excess inventory in a certain warehouse location , have that amount be distributed to the  rest of the ware house locations dependending on there demand. Basically if im overstocked send that stock to areas that need it, if the need it

 

heres an example table

 

GeoSKUInv OHBacklogOpen POsForecast availablerequiredoverstock/understock
USAG2359666251012000666212051-5389
JAPANG235959115298085560001399706029133941
FranceG23590113181013100181013213-11403

 

in this table you can see the a  certain sku is avalible in 3 warehoused . I added 2 columms , avalible(inv oh + open po) and required( backlog + forecast). The i added overstock understock  column(avalible - required) to see if there are areas with excess inventory. This is where im stuck , my idea is somethin like this:

 

GeoSKUInv OHBacklogOpen POsForecast availablerequiredoverstock/understocknew sugested distribution columntotal
USAG2359666251012000666212051-538953890
JAPANG2359591152980855600013997060291339410117149
FranceG23590113181013100181013213-11403114030

 

basically i add two new columms , the first one which analysis if there is overstock(meaning positive number) and sends that to the understocked areas( negative numbers), in this example we see on region with 133941 units of excess but to others have 5389 and  11403 respectivly of under stock. So we take 16792 from  the japan area, and send 5389 to USA aand 11403 to France. To total would add up the the remains, in this case we would still have on region overstocked but the rest would have met there demands , meaning theres a zero instead of a negative or positive

 

My idea is to use a dax measure using calculate function combined with a group by since i belive we need a way to filte sku by region since one sku can be in up to 3 different regions but my knowlegde of the calculate funtion is rather elementary at this point,

 

Please let me know if you have any queestions an thanks in advance 😃

 

 

 

 

 

 

 

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

I haven't found any category or index fields can be used as group for summary and distribute to negative value, can you please share more detail about these?

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

the key should be the combination of the SKU an the Region i belive

 

Untitled picture.png

Anonymous
Not applicable

i can also add a table with jsut the SKU list which would be unique, and create that realtion ship in the model

Anonymous
Not applicable

i added a key column , a contatination of sku and region

 

keyGeoSKUInv OHBacklogOpen POsForecast availablerequiredoverstock/understocknew sugested distribution columntotal
G2359USAUSAG2359666251012000666212051-538953890
G2359JAPANJAPANG2359591152980855600013997060291339410117149
G2359FranceFranceG23590113181013100181013213-11403114030

Hi @Anonymous ,

You can try to use following measure formula, it will summarize records based on current geo and sku group:

Measure =
CALCULATE (
    SUM ( Table[Forcast] ) - SUM ( Table[Avallable] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Gep] ),
    VALUES ( Table[SKU] )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.