Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
jip3134
Regular Visitor

help for dynamic measure with date

Hi

I used a static filter in my report in order to filter events after the date of the current day 

I oblige to update regularly this date

So I try to create a dynamic mesure 

My date field is called "Warranty expiration" (it is in a date format) and it is in this format : mardi 25 mars 2025

I have created the DAX measure below but it does'nt works

 

 

Dynamic_Warranty_Date = 
CALCULATE(
    SUM('CMDB'[Warranty expiration]),
    'CMDB'[Warranty expiration] > NOW()
)

 

Could you help please?

1 ACCEPTED SOLUTION

this works fine

Dynamic_Warranty_Date = CALCULATE(
    MAX('CMDB'[Warranty expiration]),
    FILTER('CMDB', 'CMDB'[Warranty expiration] > TODAY())
)

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Dynamic_Warranty_Date = CALCULATE(SUM('CMDB'[Warranty expiration]),filter('CMDB','CMDB'[Warranty expiration] > today()))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi

Unfortunately, it doesn't works

If i use you measure in another table, i have strange the result below

jip3134_0-1742192100060.png

 

Cannot understand unless i see your data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Show the result you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

this works fine

Dynamic_Warranty_Date = CALCULATE(
    MAX('CMDB'[Warranty expiration]),
    FILTER('CMDB', 'CMDB'[Warranty expiration] > TODAY())
)

Actually I use a manually filter in my report in order to filter the "warranty expiration" field

I just want to keep events for which the warranty expiration date is after the current expiration date

jip3134_0-1742209978675.png

so i need a measure which do that

Chewdata
Responsive Resident
Responsive Resident

Hey,

Creating a column in Power Query might be a better approach:

= Table.AddColumn(#"Changed Type", "Warranty expired", each if [Warranty expiration] <= Date.From(DateTime.LocalNow()) then true else false)

You can then filter on this column

Or if you want to use a calculated column instead:

Warranty expired =
IF(
    YOURDATA[Warranty expiration] <= TODAY(),
    TRUE,
    FALSE
    )






 

 

sorry but i need imperatively to use power bi

Chewdata
Responsive Resident
Responsive Resident

The calculated column solution is in Power BI itself:

Or if you want to use a calculated column instead:

Warranty expired =
IF(
    YOURDATA[Warranty expiration] <= TODAY(),
    TRUE,
    FALSE
    )

Add this column to the relevant table. Then you can set the filter on this column.

Hi

I have already done this and it changes nothing

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.