Forum Discussion

SebSchoon1's avatar
SebSchoon1
Icon for Post Patron rankPost Patron
3 years ago
Solved

Total is not correct.

Hi Guys,   I have  a problem to understand use of context in DAX   here is my model     Where i have only one dim table (Base Article) and one fact Table (Tableau Dispatch)   Where i w...
  • v-henryk-mstf's avatar
    v-henryk-mstf
    3 years ago

    Hi SebSchoon1 ,

     

    I can't open the link you provided for now, but for this type of problem, it should be a problem caused by the external filtering context in the created formula. Refer to the formula comparison in the following test.

    Amount_filter = sum(FactInternetSales[SalesAmount])
    Result1 =
    VAR div2 =
        CALCULATE ( [Amount_filter], ALL ( DimProduct ) )
    RETURN
        DIVIDE ( [Amount_filter], div2, BLANK () )
    
    Result2 =
    VAR div2 =
        CALCULATE ( [Amount_filter], ALLEXCEPT ( DimProduct, DimProduct[_ABC Class] ) )
    RETURN
        DIVIDE ( [Amount_filter], div2, BLANK () )

     

    More details, you can read below blog:

    Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

     

    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


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