Forum Discussion

Sentinel997's avatar
Sentinel997
Frequent Visitor
4 years ago
Solved

Show only record with current date

 

 

In a report, I get several data records under storage date (Einlagerungsdatum).
Some of these records have the same chassis number.
Does anyone have an idea that only the most recent (date) record is displayed?

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Sentinel997 ,

     

    Method1: Change the summarized type as "Latest":

    Method2:  Create a measure: 

    Latest Date = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[FZFZTP]=MAX('Table'[FZFZTP])))

    Method3: If you just want to display the latest row, please follow jbwtp 's method to create a flag measure for filter:

    Filter Flag = 
    var _latest=CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[FZFZTP]=MAX('Table'[FZFZTP])))
    return IF(MAX('Table'[Date])=_latest,1,0) 

    And then apply it to visual-level filter pane, set as "is 1":

     

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

6 Replies

  • jbwtp's avatar
    jbwtp
    Memorable Member

    hi Sentinel997,

     

    This is probably more a DAX quesiton, not Power Query.

    I think you can create a measure and then filter on it. Something like this:

    Measure = if(CALCULATE(MAX('Table'[Month]), All('Table'[Month])) = MAX('Table'[Month]), 1, 0)

    Where Table is the name of your data table and the Month is Einlagerungsdatum.

     

    Kind regards,

    John 

    • Sentinel997's avatar
      Sentinel997
      Frequent Visitor

      Thanks,

      I also think, it must be a DAX query.

      I made the entry.

      However, I get an error that at least 2 arguments are required.

       

      I'm not good at DAX. Can create a query using DAX:


      If the "Fahrgestellnummer" appears twice, then only use the latest "Einlagerdatum".

       

      Kind regards

      Anthony

        

      • jbwtp's avatar
        jbwtp
        Memorable Member

        I think there is a missing closing bracket before "=MAX" in the formula (and I guess, once you fix it there will be one redundant closing bracket at the end of the equasion).

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Sentinel997 ,

     

    Method1: Change the summarized type as "Latest":

    Method2:  Create a measure: 

    Latest Date = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[FZFZTP]=MAX('Table'[FZFZTP])))

    Method3: If you just want to display the latest row, please follow jbwtp 's method to create a flag measure for filter:

    Filter Flag = 
    var _latest=CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[FZFZTP]=MAX('Table'[FZFZTP])))
    return IF(MAX('Table'[Date])=_latest,1,0) 

    And then apply it to visual-level filter pane, set as "is 1":

     

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