Complex calculation SSAS tabular

  • I have below data set in my SSAS tabular model, for time being i have posted data for one month but the actual dataset contains number of months.

    Requirement - If any day data missing in a particular month we have to apply the below logic.  in the below case data was missed for 29-Mar-18 ,

    Get the before all last four weeks total
    (17,936.92 + 21,222.56 + 16,338.08 + 14,054.56 ) / 4  =  17,388.0
    and get the prevoius day value of the missing day = 38,057.32
    and calculate the  percentage (38,057.32 / 17,388.03) * 100 = 218 percent 

    Now i have to create below report which is showing the total sales amount for march, In case if any month has missing date then we have to apply the above logic and calculate the percent and If the Percentage is greater than 210 % then only we should show the total sales value for than particular month otherwise we have to show blank. In case if data consists for all days in a month then it should be straight forward sum otherwise if any day misses we have to apply the above logic and decide to show are not to show value in the report.

     

    Seial NoCalenderDateAmountDayName
    128-Feb-1817,936.92Wed
    21-Mar-18$15,762.60Thu
    32-Mar-18$16,575.20Fri
    43-Mar-18$11,510.84Sat
    54-Mar-18$7,402.72Sun
    65-Mar-18$17,666.52Mon
    76-Mar-18$17,119.92Tue
    87-Mar-1821,222.56Wed
    98-Mar-18$17,005.28Thu
    109-Mar-18$19,470.16Fri
    1110-Mar-18$12,438.08Sat
    1211-Mar-18$9,739.52Sun
    1312-Mar-18$15,171.64Mon
    1413-Mar-18$13,884.84Tue
    1514-Mar-1816,338.08Wed
    1615-Mar-18$14,875.76Thu
    1716-Mar-18$16,716.36Fri
    1817-Mar-18$13,023.04Sat
    1918-Mar-18$9,731.24Sun
    2019-Mar-18$15,625.92Mon
    2120-Mar-18$14,654.92Tue
    2221-Mar-1814,054.56Wed
    2322-Mar-18$16,035.64Thu
    2423-Mar-18$20,539.36Fri
    2524-Mar-18$14,389.20Sat
    2625-Mar-18$11,889.92Sun
    2726-Mar-18$16,035.76Mon
    2827-Mar-18$20,404.36Tue
    2928-Mar-1838,057.32Wed
    3029-Mar-18 Thu
    3130-Mar-18$21,573.36Fri
  • ramrajan - Wednesday, November 14, 2018 11:32 PM

    I have below data set in my SSAS tabular model, for time being i have posted data for one month but the actual dataset contains number of months.

    Requirement - If any day data missing in a particular month we have to apply the below logic.  in the below case data was missed for 29-Mar-18 ,

    Get the before all last four weeks total
    (17,936.92 + 21,222.56 + 16,338.08 + 14,054.56 ) / 4  =  17,388.0
    and get the prevoius day value of the missing day = 38,057.32
    and calculate the  percentage (38,057.32 / 17,388.03) * 100 = 218 percent 

    Now i have to create below report which is showing the total sales amount for march, In case if any month has missing date then we have to apply the above logic and calculate the percent and If the Percentage is greater than 210 % then only we should show the total sales value for than particular month otherwise we have to show blank. In case if data consists for all days in a month then it should be straight forward sum otherwise if any day misses we have to apply the above logic and decide to show are not to show value in the report.

    This is not complex and can easily be solved with some measures and a bit of DAX. The problem is, to do so, one has to build a mock model, populate it and then apply the solution, too much work for such a simple problem.
    😎

    Suggest you do either a PowerBI Desktop or Excel PowerPivot models with realistic sample data to help others helping you.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply