Shahab Haidar
Shahab Haidar

Reputation: 641

How to use default and available filter in power bi?

I have a visual for daily upload count. in which i have to show today's upload count along with previous date in filter.

My manager has asked me that user should be able to see the today's count by default and he should be able to select previous dates in drop down slicer panel.

I have taken "slicer" visual for date filters as shown in below picture.

If i publish this report with select dropdown it doesn't change after refreshing the current data. i want it to select the latest date by default when we refresh the data. and also previous dates should be there in dropdown.

enter image description here

Upvotes: 1

Views: 7077

Answers (2)

Jon
Jon

Reputation: 4967

For you use case, I would create a calculated column in your dataset that returns a flag that can be filtered for the latest date

For example:

Column = IF([Date] = TODAY(), 1, 0) 

Example

You can then set a filter on the calculated column in the filter pane, on '1' and it will show the latest selected date. When the data refreshes it will update TODAY() based on the refresh day. You can also add on/offsets, for example TODAY() +1

Another method would be to calculate the MAX date in your data set and use that to drive the filter again use the IF Clause.

It is best practice to have some sort of defined calendar table, that can drive date, period and current days/month/etc. My example can be found here

Upvotes: 1

Strawberryshrub
Strawberryshrub

Reputation: 3399

If you want a default filter you have to select it at the filter pane. Drag and drop your filter into it and select the value. Then publish your report. Now your selected filter is the default.

enter image description here

Upvotes: -1

Related Questions