Forum Discussion

Bruin87's avatar
Bruin87
Frequent Visitor
5 years ago
Solved

Filter Context - Card Visual

Hi,    I have a measure (data model: https://community.powerbi.com/t5/Desktop/Semi-Additive-Calculations-Total-Values-wrong/m-p/1824181#M707989)   Balance Closing = VAR MaxDate = MAX('Date'[Da...
  • v-robertq-msft's avatar
    5 years ago

    Hi, Bruin87 

    According to your description and DAX formula, it seems that the problem exists in the TREATAS() function you used because in this condition, your column FactBankBalances[IBAN] is always filtered by the selected value of ‘Date’[Date].

    Therefore, I think you can try to find a way to avoid using the TREATAS() function and use other functions to replace it.

     

    You can try to transform the DAX formulas I circled with the DAX below:

    VAR BalanceClosing =
    CALCULATE (
        SUM ( FactBankBalances[Kontostand_Euro] ),
        FILTER (
            ALLSELECTED ( FactBankBalances ),
            [IBAN] IN SELECTCOLUMNS ( MaxDates, "1", [@MaxDate] )
        )
    )

    More info about the TREATAS() function

     

    If you still have a problem, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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