Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

value subtraction in single column between two dates

I have table name called  Master data base . in this table have column name value  like below    Reductionbucket                             Months                        Value      OustockConsuma...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi Anonymous ,

    According to your description, if you mean when select  "6.Total FY Variation" in the slicer, it should calculate the sum of all Value in the 'Master Data Base' table, you should replace ALLSELECTED in the formula with ALL, as ALLSELECTED only contain the selected value in the slicer, but ALL return all values ignore the slicer.

    Reference: ALLSELECTED function (DAX) - DAX | Microsoft Docs

    ALL function (DAX) - DAX | Microsoft Docs

    Total Month Variation = 
    IF (
        SELECTEDVALUE ( 'Order Table'[Sno] ) = "6.Total FY Variation",
        CALCULATE (
            SUM ( 'Master Data Base'[Value] ),
            ALL ( 'Order Table'[Sno] )
        ),
        SUM ( 'Master Data Base'[Value] )
    )
    

    It works fine in my sample.

     

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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