J.Pyz
J.Pyz

Reputation: 233

Filtered LOD calculations in DAX expression Power BI

I have created LOD expressions in Tableau before which dynamically calculate when filters are applied. I am trying to achieve similar functionality in Power BI. I am very new to Power BI so I probably didn't ask google the right question. I simply want a column that shows the average sales over my "Filtered" data set. The closest I cam was using the Calculate(average(table[column]),All(table)) but that does not dynamically change when I apply the date slider. If I filter for 1/1 - 1/5 I want that average. Change the date range, the average should change.

AVG STDEV

Thank you.

Upvotes: 1

Views: 2974

Answers (2)

RADO
RADO

Reputation: 8148

CALCULATE( 
   AVERAGE(Table[Column]),
   ALLSELECTED()
)

Upvotes: 0

mendosi
mendosi

Reputation: 2051

You are probably looking for the ALLEXCEPT() function. In this case you would do something like

CALCULATE(AVERAGE(table[column]), ALLEXCEPT(table, table[date]))

that is basically saying that you want to remove all filters on the table except the filters on the date column.

Upvotes: 1

Related Questions