Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

latest submitted data over time

Here is an example of the table I have    Products Sales Reporting Date Submitted Date 5 147 10/19/2018 11/16/2018 4 985 11/11/2018 12/5/2018 1 411 12/1/2018 1/3/2019 10 ...
  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi Anonymous ,

     

    Sorry for our mistake in the formula, we can try to use the following measure to meet your requirement:

     

    Rate = 
    VAR t =
        SUMMARIZE (
            'Table',
            'Table'[Reporting Date].[Year],
            'Table'[Reporting Date].[MonthNo],
            "TotalProduct",
            VAR m =
                MAX ( 'Table'[Submitted Date] )
            RETURN
                CALCULATE ( SUM ( 'Table'[Products] ), 'Table'[Submitted Date] = m ),
            "TotalSales",
            VAR m =
                MAX ( 'Table'[Submitted Date] )
            RETURN
                CALCULATE ( SUM ( 'Table'[Sales] ), 'Table'[Submitted Date] = m )
        )
    RETURN
        SUMX ( t, [TotalProduct] ) / SUMX ( t, [TotalSales] ) * 1000

     


    Best regards,