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! Request now

Reply
Sagejah9
Helper III
Helper III

Calculate Column as measure that can be used in a slicer

Hi , 
how do you create a custom column in powerbi Dax on a table based on an IF-condition that can be used in a slicer?

SalesrepSalesrep_NumStartDateEnd Date
Joe Johnson1334Jul-1-2022Sep-10-2022
Sandra Bolt2442Jul-1-2022Sep-10-2022
Peter Stark9428Apr-2-2022Jul-1-2022
Ronaldo Forbes5920Jul-1-2022 

 

Date slicer [Jul-1-2022] to [Oct-30-2022]

How can I create a column in measure to say Yes or No if the start and end date is within the selected date range?

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Sagejah9 

you can try this

Measure = 
var _min=min('date'[Date])
var _max=max('date'[Date])
return if(min('Table'[StartDate])>=_min&&min('Table'[End Date])<=_max,"Y","N")

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Sagejah9 

you can try this

Measure = 
var _min=min('date'[Date])
var _max=max('date'[Date])
return if(min('Table'[StartDate])>=_min&&min('Table'[End Date])<=_max,"Y","N")

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @ryan_mayu , this was helpful. My only challenge is I'm not able to use the measure to filter other visuals on the page. I would like to filter Y for yes at page level filter

 

yes, measure can only add to visual filter. Let's see if anyone else can provide better solution 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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