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
EwanE
New Member

Dynamic Column based on Slicer

Hi Guys,

 

I've an issue trying to calculated column that's dynamic to a date chosen from a slicer.

 

I've managed to create a formula that gives the Max date of the slicer range and then go back 1 year.

 

Were I'm struggling is created a calculated column based on that determine if a product is "new" or "existiing"

 

For example:

 

Product A was launched on 1st July 2021.

If the slicer date range has a maximum value of 31st May 2021 - the product should be classed as "new" - launched in the last 12 months

If the slicer date range then changes to 20th July 2021 - it changes to "existing" as the launch date was greater than 12 months ago.

 

Hope that makes sense?

 

Any help is greatly appreciated.

 

Many Thanks

Ewan 

1 ACCEPTED SOLUTION
EwanE
New Member

Hi  - I managed to fix this another way using the Datebetween formula in DAX, and is giving the desired result.

 

THanks

Ewan

View solution in original post

4 REPLIES 4
EwanE
New Member

Hi  - I managed to fix this another way using the Datebetween formula in DAX, and is giving the desired result.

 

THanks

Ewan

Hi @EwanE ,

 

Happy to ear that but just one the calculated column isn't recalculating according to the date slicer correct? the values are fixed.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



EwanE
New Member

Hi @MFelix, thank you for getting to me.

 

Please see an example table below

 

Product CodeFirst Invoice DateClassification
117-May-22New
212-May-22New
311-May-22New
427-Apr-22New
520-Apr-22New
619-Apr-22New
719-Apr-22New
806-Apr-22New
906-Apr-22New
1021-Mar-22New

 

The looking to make the Classification dynamic based on the date in a slicer. If the First Invoice Date - which is Fixed is older than 12 months from the slicer it is classified as an "existing" product. if less than 12 months old, then it's classed as "new"

 

Hope that makes sense.

 

Kind Regards,

Ewan

MFelix
Super User
Super User

Hi @EwanE ,

 

Calculated columns cannot be created based on slicers, because you are refering to different context.

 

For this you need to create another measure that will then be calculated based on the slicer.

 

Can you share some sample data to get the correct measure syntax please.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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