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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rsrajkumar
Frequent Visitor

DAX expression to get records that have not been updated

Hi,

For the below table, I would like to know the 'Case Number' that have not been updated for the past 10 days by looking at the 'Modified Date' column .

 

 

Case NumberCreated DateModified Date
1560670411-Dec-2411-Dec-24
1561176610-Dec-2412-Dec-24
1561176610-Dec-2411-Dec-24
1561699210-Dec-2423-Dec-24
1561729912-Dec-2417-Dec-24
1561889412-Dec-2419-Dec-24
1561889412-Dec-2412-Dec-24

 

The result for the above table should be as below for today ie 23-Dec-2024

 

Case Numbers not updated for the past 10 days
15606704
15611766

 

Request help on this

 

Thanks

4 ACCEPTED SOLUTIONS
SachinNandanwar
Solution Specialist
Solution Specialist

 

 

Not updated for past 10 days = CALCULATE(MAX(Case_Records[Case Number]),FILTER(
        Case_Records,
        NOT(
            Case_Records[Modified Date] >= TODAY() - 10 &&
            Case_Records[Modified Date] <= TODAY()
        )))

 

SachinNandanwar_1-1734997337070.png

 



Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

View solution in original post

Sorry I didnt realise that some case numbers will have update dates that fall both within and outside the 10-day interval.

Here is the calculated table approach

 

Final_Table=

       Var _tbl=SUMMARIZECOLUMNS(Case_Records[Case Number] ,  FILTER(
        Case_Records,
        (
            Case_Records[Modified Date] >= TODAY() - 10 &&
            Case_Records[Modified Date] <= TODAY()
        )))
        RETURN  
   
  FILTER(
       DISTINCT( SELECTCOLUMNS(Case_Records,Case_Records[Case Number])),
        NOT(Case_Records[Case Number] IN (SELECTCOLUMNS(_tbl, Case_Records[Case Number]))
    ))       

 

SachinNandanwar_0-1735004045946.png

 



Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

View solution in original post

Kedar_Pande
Community Champion
Community Champion

@rsrajkumar 

Create a measure

CasesNotUpdated =
VAR LastModified =
CALCULATE(
MAX(Table[Modified Date]),
ALLEXCEPT(Table, Table[Case Number])
)
RETURN
IF(
DATEDIFF(LastModified, TODAY(), DAY) > 10,
1,
0
)

Use this measure in a visual (e.g., a table or slicer) to filter Case Numbers where the measure equals 1.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

If this helped, please give Kudos or mark it as a Solution .
Best regards,
Kedar
Connect on LinkedIn

View solution in original post

v-tangjie-msft
Community Support
Community Support

Hi @rsrajkumar ,

 

First of all thanks to Kedar_Pande for the quick reply and solution. I noticed that you also want to count the total number of records where the case has not been updated for more than 10 days, then you can create another measure.

 

(1) My test data is the same as yours.

(2) We can create a measure.

Count =
COUNTROWS (
    FILTER (
        SUMMARIZE ( 'Table', [Case Number], "flag", [CasesNotUpdated] ),
        [flag] = 1
    )
)

(3) Then the result is as follows.

vtangjiemsft_0-1735180537079.png

Best Regards,

Neeko Tang

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

10 REPLIES 10
v-tangjie-msft
Community Support
Community Support

Hi @rsrajkumar ,

 

First of all thanks to Kedar_Pande for the quick reply and solution. I noticed that you also want to count the total number of records where the case has not been updated for more than 10 days, then you can create another measure.

 

(1) My test data is the same as yours.

(2) We can create a measure.

Count =
COUNTROWS (
    FILTER (
        SUMMARIZE ( 'Table', [Case Number], "flag", [CasesNotUpdated] ),
        [flag] = 1
    )
)

(3) Then the result is as follows.

vtangjiemsft_0-1735180537079.png

Best Regards,

Neeko Tang

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

Thanks @v-tangjie-msft,@Kedar_Pande , and @SachinNandanwar . All the proposed solution by you works well! 

Kedar_Pande
Community Champion
Community Champion

@rsrajkumar 

Create a measure

CasesNotUpdated =
VAR LastModified =
CALCULATE(
MAX(Table[Modified Date]),
ALLEXCEPT(Table, Table[Case Number])
)
RETURN
IF(
DATEDIFF(LastModified, TODAY(), DAY) > 10,
1,
0
)

Use this measure in a visual (e.g., a table or slicer) to filter Case Numbers where the measure equals 1.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

If this helped, please give Kudos or mark it as a Solution .
Best regards,
Kedar
Connect on LinkedIn

@Kedar_Pande Thanks a lot. It works as intended. I would like to count the total records for which the case has not been updated for more than 10 days. While applying a filter for 'CasesNotUpdated' works on the table, it does not allow applying to a Card. 

SachinNandanwar
Solution Specialist
Solution Specialist

 

 

Not updated for past 10 days = CALCULATE(MAX(Case_Records[Case Number]),FILTER(
        Case_Records,
        NOT(
            Case_Records[Modified Date] >= TODAY() - 10 &&
            Case_Records[Modified Date] <= TODAY()
        )))

 

SachinNandanwar_1-1734997337070.png

 



Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

Thanks @SachinNandanwar . This was not working for me. It should not return 15618894 as that record was updated on 19-Dec-2024. It should return 15606704 as it was last modified on 11-Dec-2024

Sorry I didnt realise that some case numbers will have update dates that fall both within and outside the 10-day interval.

Here is the calculated table approach

 

Final_Table=

       Var _tbl=SUMMARIZECOLUMNS(Case_Records[Case Number] ,  FILTER(
        Case_Records,
        (
            Case_Records[Modified Date] >= TODAY() - 10 &&
            Case_Records[Modified Date] <= TODAY()
        )))
        RETURN  
   
  FILTER(
       DISTINCT( SELECTCOLUMNS(Case_Records,Case_Records[Case Number])),
        NOT(Case_Records[Case Number] IN (SELECTCOLUMNS(_tbl, Case_Records[Case Number]))
    ))       

 

SachinNandanwar_0-1735004045946.png

 



Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

Thanks @SachinNandanwar . When there are multiple rows for the same Case Number and some of the Last Updated Dates are more than 10 days, and a few less than 10 days, which part of the DAX expression takes care of this? Am asking this because, my actual table has more records and some of them are not working

 

Its the filter with the NOT IN clause takes care of it

FILTER(
       DISTINCT( SELECTCOLUMNS(Case_Records,Case_Records[Case Number])),
        NOT(Case_Records[Case Number] IN (SELECTCOLUMNS(_tbl, Case_Records[Case Number]))
    ))     


Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

Thanks a lot @SachinNandanwar . I learnt something new from you on creating tables , and a few new functions!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.