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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
RichyL1980
Frequent Visitor

Filter a table to then change a DAX formula

I have a Postcode Table with Lat and Lon I want to be able to filter this table down to have the result show as number 1 so it can populate a DAX formula I have to Calculate the Miles from Point to Point

 

Miles = ACOS(COS(RADIANS(90-Sheet1[Supplier Lat])) * COS(RADIANS(90-LOOKUPVALUE('Customer postcodes'[latitude],'Customer postcodes'[id],1))) + SIN(RADIANS(90-Sheet1[Supplier Lat])) * SIN(RADIANS(90-LOOKUPVALUE('Customer postcodes'[latitude],'Customer postcodes'[id],1))) * COS(RADIANS(Sheet1[Supplier Lon]-LOOKUPVALUE('Customer postcodes'[longitude],'Customer postcodes'[id],1)))) * 3959
6 REPLIES 6
RichyL1980
Frequent Visitor

This is statc data.This is statc data.This is the customer that needs to be selectedThis is the customer that needs to be selected

 

I have a filter on the customer so when one is selected it needs to change the miles in the Dax.

hi, @RichyL1980 

You should know that calculated column and calculate table can't be affected by any slicer. you could create a measure instead of column.
Notice:
1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
here is reference:
https://community.powerbi.com/t5/Desktop/Different-between-calculated-column-and-measure-Using-SUM/t...
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

Best Regards,

Lin

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

Thats for the links but a measure will not do what I require. I dont think what I am trying to do is possible but thank you all the same.

hi, @RichyL1980 

Could you please tell me if you still have other problem? If not, could you please mark the helpful replies as Answered?

 

Best Regards,

Lin

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

I will always have the problem with this one, Adding a measured column still would not produce the required result.

 

Thanks for trying to help though.

v-lili6-msft
Community Support
Community Support

hi, @RichyL1980 

Sample data and expected output would help tremendously. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Best Regards,
Lin

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

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.