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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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