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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jovendeluna21
Helper IV
Helper IV

Dynamic Value using Numeric Parameter in calculating Cashflow Opportunity

Hi,

I need help instead of fixing the opportunity to 80 days, can we input a variable using numeric parameter and the cashflow opportunity will adjust?

 

Cashflow Opportunity - indicates the total cash amount that a company will have at its disposal if payment terms with supplier would be at least "N" days, instead of current. It is zero when payment terms exceed "N" days.

 

Currently below is the calculation but I want the 80 to be dynamic number based on the entered numeric parameter.

jovendeluna21_1-1734598472404.png

 

 

jovendeluna21_0-1734598438736.png

 

 

I attached here the pbi copy.

https://drive.google.com/file/d/10H0HMRS9AIp2WpSTtk5rl9buKUz0V5sd/view?usp=sharing

 

1 ACCEPTED SOLUTION

Change your formula to this

Adjusted Cashflow Opportunity = 
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Supplier Name],
            'Table'[Net Days],
            'Table'[Spend]
        ),
        "@Cashflow",
           MAX( ( [Opportunity Variable Value] - [Net Days] ), 0 ) * DIVIDE ( [Spend], 360 )
    ),
    [@Cashflow]
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

8 REPLIES 8
jovendeluna21
Helper IV
Helper IV

Hi, @danextian, I already solved it by modifying your given calculation:

Adjusted Cashflow Opportunity =
SUMX (
    ADDCOLUMNS (
        -- Calculated to be evaluated based on these columns
        SUMMARIZE (
            'Table',
            'Table'[Supplier Name],
            'Table'[Net Days],
            'Table'[Spend per Day]
        ),
        "@Cashflow",
            IF(
                [Opportunity Variable Value] <= [Net Days],
                0,
                ( [Opportunity Variable Value] - [Net Days] ) * [Spend per Day]
            )
    ),
    [@Cashflow]
)
Ritaf1983
Super User
Super User

Hi @jovendeluna21 

You need to create measures instead of calculated columns to use a parameter , for example :

Ritaf1983_0-1734599746501.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks @Ritaf1983 , it works however can we consider also this "It is zero when Net Days exceed "N" days.

can you give more details about what you mean...it sounds like just to ad OR ...and one more condition, 
but I am not sure that I understood you correctly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

For example, If I enter 70, the cashflow opportunity for Supplier A should be 400,000. Calculated as the Opportunity variable minus the Net Days multiply by the Spend per Day. ((70-30)*10,000).

For Supplier B, the cashflow opportunity should be 0, since the Net Days of 80 is greater than the Opportunity Variable of 70.

For the total, it should be 400,000.

danextian
Super User
Super User

Hi @jovendeluna21 

 

Try this:

 

Adjusted Cashflow Opportunity = 
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Supplier Name],
            'Table'[Net Days],
            'Table'[Spend]
        ),
        "@Cashflow",
            ( [Opportunity Variable Value] - [Net Days] ) * DIVIDE ( [Spend], 360 )
    ),
    [@Cashflow]
)

 

danextian_0-1734599328833.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks @danextian  , it works however can we consider also this "It is zero when Net Days exceed "N" days. For example if I enter 70, Supplier B's Adjusted Cashflow Opportunity should be zero since its Net Days is 80 which is less than the Opportunity Variable entered which is 70.

Change your formula to this

Adjusted Cashflow Opportunity = 
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Supplier Name],
            'Table'[Net Days],
            'Table'[Spend]
        ),
        "@Cashflow",
           MAX( ( [Opportunity Variable Value] - [Net Days] ), 0 ) * DIVIDE ( [Spend], 360 )
    ),
    [@Cashflow]
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.