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
Anonymous
Not applicable

insert a date filtered by slicer in new measure

Hi everyone,

I’ll thank you if you could tell me how could I replace a date value in a formula by the result of a value slicer

 

When I insert the date value I get the desired result

Sales = CALCULATE(COUNTROWS(sales);

FILTER(ALL(sales);sales[date]<DATE(2019;4;4));

FILTERS(sales[date])

)

date.png

But if I replace the date with SELECTEDVALUE I get the table empty

 

Sales = CALCULATE(COUNTROWS(sales);

FILTER(ALL(sales);sales[date]<SELECTEDVALUE(Sales[date]));

FILTERS(sales[date])

)

date0value.png

Thanks again

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

You could refer to below steps:

Sample data:

1.PNG

Create a new table:

New Table = VALUES(Table1[Date])

2.PNG

Use the New table date as slicer and create below measure:

Measure = CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Date]<=SELECTEDVALUE('New Table'[Date])))

Result:

3.PNG

Regards,

Daniel He

Community Support Team _ Daniel He
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

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

You could refer to below steps:

Sample data:

1.PNG

Create a new table:

New Table = VALUES(Table1[Date])

2.PNG

Use the New table date as slicer and create below measure:

Measure = CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Date]<=SELECTEDVALUE('New Table'[Date])))

Result:

3.PNG

Regards,

Daniel He

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

thank you @v-danhe-msft 

I get the result still empty. I'll check it again carefully in case i miss something

Hi @Anonymous ,

Could you have used the data column in new table(created by dax) as the slicer? And please check with your dax formula.

 

Regards,

Daniel He

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

 

At the end, I redesinged a couple of concepts and measures and got the result in other way.

 

Thanks a lot fot the help, @v-danhe-msft 

 

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.