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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
MatiasM
Frequent Visitor

What can I afford with my budget?

Hi all,

 

I'm trying to analyze what funding can I afford based on budget filter.

I'll show the example below.

 

MatiasM_0-1697746508883.png

I do have different regions and I want to create a filter where, If I select a budget of "$35,000" it will filter the table to the regions I can afford (as a SUM), in this case it would be Mid Cantebury($12,000) and Ruapehu Whanganui ($20,000). If I select a budget of "$65,000" it will add Bay of Plenty ($32,142.86) with the regions noted before.
This is a plain table with not relationships in the Model View.

I hope you can help me, please let me know if you require more information.

 

Thanks

7 REPLIES 7
parry2k
Super User
Super User

@MatiasM are you sorting the region column by any other column? Can you put a sample pbix file and share using one drive/google drive?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yeap,

 

parry2k
Super User
Super User

@MatiasM it assume that you are using only one table, can you share dax expression you used?

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi parry2k,

 

Have you got any thoughts about this? If not is fine I can try something else.

 

Regards

Sum Funding = SUM(Regions[Funding])
 
Sum Funding Afford =
VAR __Table =
ADDCOLUMNS (
    ALL ( Regions ),
    "@Sum",
    CALCULATE (
        [Sum Funding],
        WINDOW (
            1, ABS,
            1, REL,
            ALL ( Regions[Region ] ),
            ORDERBY ( [Sum Funding], ASC )
        )
    ),
    "@Limit", [Parameter Value]
)
RETURN
CALCULATE (
    [Sum Funding],
    KEEPFILTERS ( FILTER ( __Table, [@Sum] <= [@Limit]  ) )
)

MatiasM_0-1697772197378.png

 





parry2k
Super User
Super User

@MatiasM create a what-if parameter for the value selection, read here how to do this,  Use parameters to visualize variables - Power BI | Microsoft Learn

 

and then add the following measures and use Sum Funding Afford in the visual:

Sum Funding = SUM ( 'Table'[Funding] )

Sum Funding Afford = 
VAR __Table = 
ADDCOLUMNS ( 
    ALL ( 'Table' ),
    "@Sum", 
    CALCULATE ( 
        [Sum Funding],
        WINDOW (
            1, ABS,
            1, REL,
            ALL ( 'Table'[Region] ),
            ORDERBY ( [Sum Funding], ASC )
        )
    ),
    "@Limit", [Parameter Value]
)
RETURN
CALCULATE ( 
    [Sum Funding],
    KEEPFILTERS ( FILTER ( __Table, [@Sum] <= [@Limit]  ) )
)

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

HI @parry2k ,Thanks for this.

I might be doing something wrong? Because the parameter is showing all the values that are under 50000. Instead of what could sum up within the budget of 50000.

MatiasM_0-1697770268415.png

 

 

Thanks again

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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