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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
CoTheiss
Frequent Visitor

Calculated column with max(selectedvalue) from field

Hey guys

 

I am trying to create a True/False field based on different constraints with one constraint that should be dynamic due to a field selection. 
In the past I worked with other BI-tools, however I started with PowerBI few months ago and my personal guess is, that the solution is either super easy or I need to completely rewrite it, as "you cannot do this in calculated columns".

 

Here is the column without the dynamic constraint (this works fine):

IsExpiring =
if( LEN('Periods'[PeriodFrom])<1 || LEN('Periods'[PeriodTo])<1,
 FALSE,
if(
'Periods'[PeriodFrom]<=TODAY() && 'Periods'[PeriodTo]>=today() && ('Periods'[PeriodTo]<=today()+20)
,TRUE,
FALSE
))

 

Now, I want to make this dynamic:

By replacing the +20 by the max selected value in the field Sel_ExpiryDate[Days], which is a data island (no relations to any other table) solely for selecting the maximum number of days that should be added.

 

While the posted calculated table is working fine, it does calculate the max(Sel_ExpiryDate[Days]) so far, whatever I try.

Tried so far: 

- entered max(Sel_ExpiryDate[Days]) directly

- created a measure with max(Sel_ExpiryDate[Days]) in the Sel_ExpiryDate table

-created a measure with max(Sel_ExpiryDate[Days]) in the Period table

 

2 REPLIES 2
CoTheiss
Frequent Visitor

@HotChilli  yes it is a slicer with a slider.

 

I wanted to give the user the flexibility to choose the number of days. 

 

If there are better solutions to not just have a fixed measure but instead give the user some flexibility here - that would be awesome 🙂 

HotChilli
Super User
Super User

"solely for selecting the maximum number of days" -> How is this selected? In a slicer or filter?  If so, the calculated column won't react to that.

A measure would react to it.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors