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
cottrera
Post Prodigy
Post Prodigy

DAX Calculating distributed spend using a distribution table

Hi 

 

I have an address table with a dax function  that give me spend per address

AddressSpend
1 Nonsense Street, London£200
2 Unknown Road, London£1,506
3 High Road, London£20,000
4 Dax Lane, London£3,200
5 Power Road, London£760
6 Excel Street, London£901
7 Variable Lane, London£40,000
8 Calculate Street, London

£2,400

 

 

I have a second table I would like to use for calcualting distribution of spend by address

 

Table called *Repairs Spend Distribution
    
DistributionMinMaxOrder
£0-£50005001
£500-£2,00050120002
£2,000-£3,000200130003
£3,000-£4,000300140004
£4,000-£20,0004001200005
£20,000-£50,00020001500006

Dax I have tried but not working

Repairs Spend Distibution =
CALCULATE(
SELECTEDVALUE('*Repairs Spend Distribution'[Repairs Spend],BLANK()), FILTER(
ALL('*Repairs Spend Distribution'), [Repairs Spend]
>= '*Repairs Spend Distribution'[Min] && [Repairs Spend]
<= '*Repairs Spend Distribution'[Max]))
 
I get an error when adding this DAX to my visual results. I was expecting this result
AddressSpendExpected result
1 Nonsense Street, London£200£0-£500
2 Unknown Road, London£1,506£500-£2,000
3 High Road, London£20,000£4,000-£20,000
4 Dax Lane, London£3,200£3,000-£4,000
5 Power Road, London£760£500-£2,000
6 Excel Street, London£901£500-£2,000
7 Variable Lane, London£40,000£20,000-£50,000
8 Calculate Street, London£2,400£2,000-£3,000
 
Can you advise where I am going wrong.
 
Richard
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @cottrera 

 

Please try the below.

 

Repairs Spend Distibution =
CALCULATE (
SELECTEDVALUE ( '*Repairs Spend Distribution'[Distribution], BLANK () ),
FILTER (
ALL ( '*Repairs Spend Distribution' ),
[Repairs Spend] >= '*Repairs Spend Distribution'[Min]
&& [Repairs Spend] <= '*Repairs Spend Distribution'[Max]
)
)
 
Also, please check [Repairs Spend] is a measure, not a column.
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi, @cottrera 

 

Please try the below.

 

Repairs Spend Distibution =
CALCULATE (
SELECTEDVALUE ( '*Repairs Spend Distribution'[Distribution], BLANK () ),
FILTER (
ALL ( '*Repairs Spend Distribution' ),
[Repairs Spend] >= '*Repairs Spend Distribution'[Min]
&& [Repairs Spend] <= '*Repairs Spend Distribution'[Max]
)
)
 
Also, please check [Repairs Spend] is a measure, not a column.
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.