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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Frequent Visitor

This is statc data.This 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.

Community Support

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.
Frequent Visitor

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.

Community Support

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.
Frequent Visitor

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.

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

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors