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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TSoren23
Regular Visitor

Using a slicer value in a column calculation

Newer to Power BI, 

I am develping a report that will return distance people will need travel to a job site. I have a zipcode database that returns the Longitude and latitude for each zipcode for the workers. I have a slicer I can enter the site zipcode and will return the Longitue and Latitude for that site. The math is not the problem to calculate the didstance, I am having trouble using the returned Long and Lat of the site from the slicer to use in the calculation in the distance column for the table. Example" 

Part of the distance calc

COS(RADIANS(longitude site-longitude worker))

I get the "Long worker" value but I can not get the "Long site" value from the slicer to use in the calculated column for the results. 

 

1 REPLY 1
Anonymous
Not applicable

@TSoren23  Have you tried using the SELECTEDVALUE function in your measure? Maybe you could store the slicer's selected value in a variable in your measure and use it.

https://learn.microsoft.com/en-us/dax/selectedvalue-function

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.