Forum Discussion

zibster's avatar
zibster
Helper III
6 years ago
Solved

Calculating daily Sales

Hi,

I am trying to calculate daily projection from the total weekly amount, the %ByDayForTheWeek is a calculated value. Below is an example of how I would do this in excel. Please help

 

  • Hi zibster ,

     

    We can try to create a calculated column in “Split By Day Table” Table using following dax to meet your requirement:

     

    Ounput =
    [%ByDayForTheWeek]
        * CALCULATE (
            SUM ( 'Sales Table'[SalesProj] ),
            FILTER (
                'Sales Table',
                'Sales Table'[Facility] = EARLIER ( 'Split By Day Table'[Facility] )
                    && 'Sales Table'[Department] = EARLIER ( 'Split By Day Table'[Department] )
                    && 'Sales Table'[WeekID] = EARLIER ( 'Split By Day Table'[WeekID] )
            )
        )

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    Best regards,

     

3 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi zibster ,

     

    We can try to create a calculated column in “Split By Day Table” Table using following dax to meet your requirement:

     

    Ounput =
    [%ByDayForTheWeek]
        * CALCULATE (
            SUM ( 'Sales Table'[SalesProj] ),
            FILTER (
                'Sales Table',
                'Sales Table'[Facility] = EARLIER ( 'Split By Day Table'[Facility] )
                    && 'Sales Table'[Department] = EARLIER ( 'Split By Day Table'[Department] )
                    && 'Sales Table'[WeekID] = EARLIER ( 'Split By Day Table'[WeekID] )
            )
        )

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    Best regards,