eponkratova
eponkratova

Reputation: 477

Group by date, Distinct and ignore other filters - Power BI

I have the dataset where the values in the col 'value' are repeated per month and id, e.g. for 1/1/2020 and id 1, the value is 0.5, for 2/1/2020, the value is 2, etc. The dataset has other columns which are to be used as filters for other calculations.

enter image description here

What will be the measure to get:

enter image description here

so that even when I use filters from the table, e.g. filter1, the value remains grouped by date ONLY?

I've tried with sumx and max; sum and value but nothing gives a result and calculation still reacts on other filters.

Upvotes: 0

Views: 1191

Answers (1)

msta42a
msta42a

Reputation: 3741

When i spoke abount ALL i had in mind this kind of solution:

WithoutExternalFilter =
CALCULATE (
    VAR __dist =
        ADDCOLUMNS (
            SUMMARIZE ( Te, Te[Date], Te[ID] ),
            "val", CALCULATE ( MAX ( Te[value] ) )
        )
    RETURN
        SUMX ( __dist, [val] ),
    ALL ( Te[filter1] )
)

enter image description here

WHEN we put some filter, value for "2020-08-01" is still 1.1:

enter image description here

Upvotes: 1

Related Questions