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
12Bowers12
Helper V
Helper V

Using Slicer or Filter Pane to change the selected date

Hello, everyone,

This question is partially related to my previous question.

In insurance industry, there is one terminology named Earned Premium. For instance, given a policy with $1,000 effective on 01/01/2020 and expired on 12/31/2020, on 06/30/2020, the Earned Premium is $500 since 6 months has passed and therefore half of the premium is earned by insurance company.

In math formula, the Earned Premium = 1000 * (06/30/20 – 01/01/20) / (12/31/20 – 01/01/20).

Similarly, in the following query, I tried to get the Earned Premium.

For the ValueDate, is it possible to use Slicer or Filter Pane on DateDim[DateKey] to change the date on ValueDate? Right now, I use VAR to define the date for ValueDate but it's too static. 

Appreciate your help.

Dennis

 

PolicyData[PREMIUM] *

DIVIDE ( ValueDate - PolicyData[EFFECTIVE_DATE],

              PolicyData[EXPIRE_DATE] - PolicyData[EFFECTIVE_DATE] )

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

You should be able to use MAX(DateDim[DateKey]) to get the ValueDate (or the column that has the date in Date format).

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

You should be able to use MAX(DateDim[DateKey]) to get the ValueDate (or the column that has the date in Date format).

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you very much, Allison,

It's perfect to combine with Filter Pane.

Before I tried to create a parameter table with Date information. But the report becomes too complex. 

Have a good day.

Dennis

You're very welcome. 🙂

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.