cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Post Prodigy

## Create measure filter

I need to create a measure that makes a calculation by there a filter I do, for example, calculate (sum (table [column]); table [column that will suffer the filter]) in my case would be the year filter

5 REPLIES 5
Community Champion

@vitexo87 If you are going to use a Slicer or Filter - why add the filter in the Formula as well?

Can you explain better?

Post Prodigy

For the filter to determine a value for a single object, which will be using this measure,

for example: I have a graph and want their values to be displayed only when a filter is done year

some would like this: Sum ({\$ <Year = {'<= \$ (= Only (Year))'}, Month =>} Vl Rest processed)

Community Champion

I don't get this. But you can always hard code the filter like this for example

2015 Total = CALCULATE (SUM(Table[Column]), CalendarTable[Year]=2015)

If you want to do Year to Date = TOTALYTD(SUM(Table[Column]), CalendarTable[Date])

Super User

@Sean's method was one of the alternatives that I was alluding to. The equivalent in SUMX syntax is:

`=SUMX(FILTER(Table, Table[Year]=2015),[ColumnToSum])`

Here is an article on SUM vs. SUMX vs. CALCULATE

http://www.powerpivotpro.com/2014/10/sum-sumx-or-calculatechoices-choices/

The article isn't complete as it doesn't mention that you can also change the filter context with SUMX.

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Super User

Couple different ways of doing that, but I would use SUMX

https://msdn.microsoft.com/en-us/library/ee634959.aspx

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors