Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Creating daily report with MTD data

Hi,   I'm planning to create a daily report with data pulled out of BW.   The data would always be MTD, so every day I would save a file 2019.01.01, 2019.01.02 etc that contains all sales up to t...
  • MFelix's avatar
    7 years ago

    Hi Anonymous,

     

    If you do the option to connect to folder and use the name file to have a date column then based on that column you can use a measure similar to this one:

     

    daily sales =
    VAR date_selection =
        CALCULATE (
            MAX ( Sales[Date] );
            FILTER ( ALL ( Sales[Date] ); Sales[Date] < MAX ( Sales[Date] ) )
        )
    RETURN
        SUM ( Sales[Sales] )
            - CALCULATE (
                SUM ( Sales[Sales] );
                FILTER ( ALL ( Sales[Date] ); Sales[Date] = date_selection )
            )

    This will give you the result below:

     

     

    Regards,

    MFelix