cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
No1
Frequent Visitor

Calculatetable by value derived from picked measure

Hi, 

I want to create a table which only shows values that have the same long- and latitude (one or two digits after the dot) as the asset that I choose in the search-slicer.

This way you are able to filter the map with locations that are in a range of the selected point.

Step1. I choose a asset.
Step2. Based on the longtitude and latitude of this asset, the table gets filtered.

I am having trouble filtering the table though. Only the value of the chosen asset shows up.

Is it because you can't filter a table on a value, derived from a measure, or is there a way to fix this in DAX?

Many thanks in advance.

Locatie Table = FILTER('Last location';('Last location'[TNT Prod AssetLocation.Longitude - Text]=([Longtitude])))
Longtitude = IF(HASONEVALUE('CMD Prod Asset'[ShortNumber - Text]);MAX('Last location'[TNT Prod AssetLocation.Longitude - Text]);"Longtitude")


image.png
image.png



 

2 REPLIES 2
amitchandak
Super User
Super User

You need to have one or more measure or all the measure having the filter

FILTER('Last location';('Last location'[TNT Prod AssetLocation.Longitude - Text]=([Longtitude])))

 

that will restrict the content



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

edhans
Super User
Super User

Is your data rounded to 2 places before it gets loaded? If not, that is your problem. Changing how it looks doesn't change the underlying data, so if you are selecting a record with 25.25 latitude, but internally it is 24.249233, it will not match against another record that also shows 25.25, but internally is 25.252113

 

Use the Number.Round() function in Power Query (or Rounding on the Transform tab) to round before DAX sees it.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!