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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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