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
Bokchoy
Helper II
Helper II

Pre set Min/Max date values in custom measures

Hi All,

 

I've got 2 measures that retrieve Min/Max value of my calendar table using the min/max functions. The slicer then controls the min/max values as shown below.

Bokchoy_0-1646692319277.png

 

Im trying to create a custom Column that can filter clients based on whether they have traded between the 2 custom dates.

 

Custom test = 
var start_ = traded_start[Traded_min]
var end_ = traded_start[Traded_max]
var calc_ = IF(CALCULATE(DISTINCTCOUNT(Client[Client_id]), filter(all(Jobs_new),Jobs_new[JOB_DATE] >= start_ && Jobs_new[JOB_DATE] <= [Traded_max])), "Traded","No Trade")
return calc_

 

My custom column is not working because the min/max measures become unfiltered and return the min/max of the calendar table instead of the slicer-defined values.

 

Bokchoy_1-1646692524847.png

 

Does anyone know how to fix this? Thanks in advance.

 

 

1 ACCEPTED SOLUTION

@Bokchoy 
As my knowledge goes, I don't think it's even possible and frankly, I am not sure about the actual use case.
If you need a table with dynamic value, just create the same Table as Visual and add the new measure as the column and then you have your desired Column, you can then export that table or do other stuff with it.
The Measure you used will most likely work for the desired column.

View solution in original post

3 REPLIES 3
vojtechsima
Memorable Member
Memorable Member

Hi, @Bokchoy ,
if you want the new measure to be dynamically chosen by the two slicers, just use in your new measure following:

var mindate = MIN('Your Table'[YourDate])
var maxdate= MAX('Your Table'[YourDate])

and you're simply done.

 

Hi Vojtechsima, 

Sorry, i didn't explain my question clearly. I'm trying to create a custom column, not a measure. I've updated the post

@Bokchoy 
As my knowledge goes, I don't think it's even possible and frankly, I am not sure about the actual use case.
If you need a table with dynamic value, just create the same Table as Visual and add the new measure as the column and then you have your desired Column, you can then export that table or do other stuff with it.
The Measure you used will most likely work for the desired column.

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.