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
edwardrmiles
Helper III
Helper III

Using measures in calculated columns without losing filter context

 

I'm trying to create a calculated column that dynamically constructs a URL based on a value in the host table and the minimum and maximum dates in the filter context of the visualisation.  

 

I'm running into problems because the filter context of the visualization doesn't work if I try to calculate minimum and maximum dates in a calculated column.  It does work if I refer to a measure in that calculated column but then when I try and concatenate two measures in a column the filters are lost again.  I have to use a calculated column because I want to the URL string to behave as a URL.

 

Is there a way around this problem? 

 

// Works, filter context from the visualisation is applied
Min Date Measure = FORMAT(min('MyTable'[Date]),"YYYYMMDD")
Max Date Measure = FORMAT(max('MyTable'[Date]),"YYYYMMDD")
Min Date Calculated Column = [Min Date Measure]
Max Date Calculated Column = [Max Date Measure]

// Doesn't work, filter context not applied so you get the min and max dates in the entire table
MIN and MAX Dates  Calculated Column = [Min Date Measure]&[Max Date Measure]

//Doesn't work, because measures can't be formatted as a URLs
MIN and MAX Dates  Measure = [Min Date Measure]&[Max Date Measure]

 

Capture4.PNG

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @edwardrmiles,

 

Based on my test, it seems there is no possibility to do that. As we all know, the calculated column values are static once it is created. Filter context won't affect the calculated column.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.