Forum Discussion
Is it possible to filter by current date?
seth127 Just add the additional filter to those Measures so they only calculate for today
Today's Sales =
IF (
ISBLANK ( CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Date] = TODAY () ) ),
0,
CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Date] = TODAY () )
)
EDIT: IF ( ISBLANK... will help you deal with Blank() showing in some Visuals such as Cards when there's no value - it will show 0 instead
- seth12710 years agoRegular Visitor
Thanks. That looks great, but I'm worried I won't be able to use it. I'm connected through SSAS, which means I can't create calculated columns. That's what you're saying to do, right?
If I'm misunderstanding you, I'd love to know how to put a calculated measure into a card or something without having to create a new column. I haven't been able to figure that out either.
If that is what you were suggesting, is there a way to do this without creating a new column? Basically I want to have it work just like the filters on the right hand side work, but have it update to the current date each day.
Thanks again.
- v-qiuyu-msft10 years agoCommunity Support
Hi seth127,
To add a calculated column which suggested by Sean is after loading data in Power BI Desktop, instead of in SSAS model. For more information, please refer to this article: Calculated columns in Power BI Desktop.
In addition, we are not able to set Report level filter based on dynamic values, we can only set specified values currently. So in your scenario, as you want to set default filter as Today() and user can also select other date, it's not supported to do it as far as I know. For this issue, I have sent a feedback internally. You can refer to this thread which I have replied: Options to have report parameters similar to what we have in SSRS.
If you have nay question, please feel free to ask.
Best Regards,
Qiuyun Yu