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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

New Customers based on Slicer

Date.PNG

I want to calculate new customer Trend on date column based on slicer  (Type). 

 

When Slicer selection Type = "ALL", this customer should show as new  on 1/1/2020

When Slicer selection Type = A, this customer should show as new  on 1/1/2020

When Slicer selection Type = B, this customer should show as new  on 1/2/2020

When Slicer selection Type = C, this customer should show as new  on 2/1/2020

 

I tried using Earlier DAX function but Earlier is not helping with the slicer. Can we have a dynamic measure to get the new customers based on slicer selection option.

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

First, you should know that:

1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

Second, for your case, you could try this measure

Measure = 
IF(SELECTEDVALUE('Table'[Date])=CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table')),"New")

or

Measure 2 = 
IF(SELECTEDVALUE('Table'[Date])=CALCULATE(MIN('Table'[Date]),FILTER(ALLSELECTED('Table'),'Table'[ID]=MAX('Table'[ID]))), "New")

Result:

5.JPG6.JPG7.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

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

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

First, you should know that:

1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

Second, for your case, you could try this measure

Measure = 
IF(SELECTEDVALUE('Table'[Date])=CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table')),"New")

or

Measure 2 = 
IF(SELECTEDVALUE('Table'[Date])=CALCULATE(MIN('Table'[Date]),FILTER(ALLSELECTED('Table'),'Table'[ID]=MAX('Table'[ID]))), "New")

Result:

5.JPG6.JPG7.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

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

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors