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

I want to see the values before the date selected in the slicer

I have a measure that brings the maximum date for that particular row. Let's say sold date. One item could be sold many times because it's returned or any other reason.

 

I want to see the records when I select a date (single selection), that date and previous dates should be included in my matrix kpi 

 

please ask me if you have any questions 
thanks

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

Hi @Anonymous ,

 

Approve with @amitchandak .

Here is my sample:

vjianbolimsft_1-1674627525913.png

Please try:

First create a date table for slicer:

vjianbolimsft_0-1674627330374.png

Note: The Date table do not have relationship with your fact table.

Then apply the measure to your visual's filter:

Measure = IF(MAX('Table'[Date])<=MAX('Date'[Date]),1,0)

vjianbolimsft_2-1674627599452.png

Final output:

vjianbolimsft_3-1674627639187.png

Best Regards,

Jianbo Li

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

@amitchandak thank you.

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Approve with @amitchandak .

Here is my sample:

vjianbolimsft_1-1674627525913.png

Please try:

First create a date table for slicer:

vjianbolimsft_0-1674627330374.png

Note: The Date table do not have relationship with your fact table.

Then apply the measure to your visual's filter:

Measure = IF(MAX('Table'[Date])<=MAX('Date'[Date]),1,0)

vjianbolimsft_2-1674627599452.png

Final output:

vjianbolimsft_3-1674627639187.png

Best Regards,

Jianbo Li

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

Anonymous
Not applicable

Hello there,

I would appreciate it if you shared pbix file so I can see how it's working

thanks

amitchandak
Super User
Super User

@Anonymous , If you only need value

 

You can create a measure like

measure  = calculate(Sum(Table[Value]), filter(all(Date), Date[Date]) < Max(Date[Date]) ))

 

or

 


new measure =
var _max = maxx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] <=_max))

 

But you need show date on axis ,then you need slicer on independent table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] <=_max))

 

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

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.