Forum Discussion

hilvie's avatar
hilvie
Frequent Visitor
4 years ago
Solved

Supressing values from a table

Hi there, I`m using measures to determine the difference between months (current en past year). The financial table uses a number for a month and I have a date table connected with it. I have a visu...
  • v-jianboli-msft's avatar
    4 years ago

    Hi hilvie ,

     

    Based on your description, I have created a simple sample like this:

     

    Please try:

     

    Diff =
    VAR _currentyear =
        YEAR ( TODAY () )
    RETURN
        IF (
            MAX ( 'Calendar'[Month] ) <= MONTH ( TODAY () ),
            SUMX (
                FILTER (
                    'Table',
                    [Month] = MAX ( 'Calendar'[Month] )
                        && YEAR ( [Date] ) = _currentyear
                ),
                [Value]
            )
                - SUMX (
                    FILTER (
                        'Table',
                        [Month] = MAX ( 'Calendar'[Month] )
                            && YEAR ( [Date] ) = _currentyear - 1
                    ),
                    [Value]
                )
        )
    

     

    Then select show items with no data:

    Final Output:

    If the result is not what you want, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

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