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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
fyong
Frequent Visitor

How to count balance for replenish ?

 Hi Team , 

 

Can anyone share with me the dax function to get the outcome at "want this outcome" column?

I have created many to many relationship , matrix table .

bi document.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @fyong 

You can refer to the following measure

 

Balance_ =
[PO QTY]
    - SUMX (
        FILTER (
            ALLSELECTED ( 'Demand Table' ),
            [Item ]
                IN VALUES ( 'Demand Table'[Item ] )
                    && [Ordered_Date] <= SELECTEDVALUE ( 'Demand Table'[Ordered_Date] )
        ),
        [Demand QTY]
    )

 

vxinruzhumsft_0-1692857329890.png

 

Best Regards!

Yolo Zhu

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

9 REPLIES 9
fyong
Frequent Visitor

Hey @fyong ,

make sure that no login is required for downloading the file(s).

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hey @fyong ,

 

now I'm able to download, the file, but still there is not explanation on how to create the values in the expected output column. Without providing business rules, it's not possible to create any DAX.

 

For me the information you provided so far is not sufficient, for this reason, I will not be able to help you on this question.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi Tom , 

 

Actually i want to know what is the shortfall quantity day to day comparing to customer demand and On hand stock ( Open PO &Inventory).

The similarity is the item number . 

Anonymous
Not applicable

Hi @fyong 

You can refer to the following measure

 

Balance_ =
[PO QTY]
    - SUMX (
        FILTER (
            ALLSELECTED ( 'Demand Table' ),
            [Item ]
                IN VALUES ( 'Demand Table'[Item ] )
                    && [Ordered_Date] <= SELECTEDVALUE ( 'Demand Table'[Ordered_Date] )
        ),
        [Demand QTY]
    )

 

vxinruzhumsft_0-1692857329890.png

 

Best Regards!

Yolo Zhu

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

Hi Yolo Zhu , 

My balance is incorrect if i have mutliple orders within the same day. DO you have any idea to solve this ? I have attached link for your reference

https://drive.google.com/file/d/1DoUxzzaPoWpg3NveGspznJokypGygsHU/view?usp=drive_link 

fyong_0-1693213744160.png

 

Hi Yolo Zhu, 

 

Thanks for the solution . I really appreciate it .

TomMartens
Super User
Super User

Hey @fyong ,

 

I'm. not able to create any DAX without knowing what to do, only staring at the outcome column will create a solution that most likely is based wrong assumptions. You mentioned that you created many-to-many relationships between tables, is my understanding correct? Without knowing the exact relationships it's also not possible to create a DAX measure.

Consider creating a pbix that contains sample data, but still reflects your data model (tables, relationships, calculated columns, and measures). Upload the pbix to onedrive, google drive, or dropbox. If you are using Excel to create the sample data instead of the manual input method, then share the xlsx sheet as well. Do not forget to explain the expected result based on the data you provided.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.