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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.