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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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