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
mhsk
Helper II
Helper II

calculation based on 2 tables with calendar

 

 

i'm having trouble creating a measure to show me calculation from 2 tables.

 

My model looks like this:

Przechwytaaaywanie.JPG

What i would like to achieve is to take starting_QOH (there is just one starting_QOH in in_mstr under in_part) and decuct from this starting_QOH demand for each week and each item and add open PO for each part for each week.

 

so my expected result is as below (mind i have many of in_part):

Przechwytywaniexxxxxxxx55xxx.png

i can catch the starting value to make the calculation, would you help?

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @mhsk ,

If you can please share some sample data for test, it is hard to test without any sample data.

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

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

Hi, pbix file can be found here:

 

https://app.box.com/s/jlhtu79kzbmfwkcs018olv5tg43vjfis

 

Please do not apply changes on query all I have is already imported into the model, the goal is to get Quantity on Hand value for each item and minus it with demand and plus with supply for each week. For next week start should be the previous week end value. @v-shex-msft Thanks in advance for suggestions and feedback.

any ideas? what im looking for is a rolling calculation with set start and change week by week

Hi @mhsk ,

You can use following measure if it suitable your requirement:

Measure =
VAR currDate =
    MAX ( ActualDate[Date] )
RETURN
    SUM ( 'Quantity on Hand'[QOH] )
        - CALCULATE (
            SUM ( demand[Demand QTY] ),
            FILTER ( ALLSELECTED ( ActualDate ), [Date] <= currDate )
        )
        + CALCULATE (
            SUM ( supply[Open PO] ),
            FILTER ( ALLSELECTED ( ActualDate ), [Date] <= currDate )
        )

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.