cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Calculate With Filter but ignoring slicers

Hello,

As the title says I want to calculate the sum of a column ignoring the slicers in place.

It can be done with ALL.

Measure=Calculate(sum(table[amounts]),All(Table))

However I also want to filter sum of the amounts to the value of another column , year.

Measure=Calculate(sum(table[amounts),Filter(table,Table[Year]="2020"))

Something like above but which ignores the slicers. Is it possible?

Thanks

2 ACCEPTED SOLUTIONS
Super User

@Anonymous , Not sure I got you completely. Try like

Measure=Calculate(sum(table[amounts),Filter(all(table),Table[Year]="2020"))

Community Support

Hi  @Anonymous ,

I created the data:

Here are the steps you can follow：

1. Create measure.

``````select =
var _selectyear=SELECTEDVALUE('Table'[Year])
return
IF(HASONEVALUE('Table'[date]),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Year]=_selectyear)),
SUMX(ALL('Table'),'Table'[amount]))``````

2. Result.

Best Regards,

Liu Yang

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

4 REPLIES 4
Community Support

Hi  @Anonymous ,

I created the data:

Here are the steps you can follow：

1. Create measure.

``````select =
var _selectyear=SELECTEDVALUE('Table'[Year])
return
IF(HASONEVALUE('Table'[date]),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Year]=_selectyear)),
SUMX(ALL('Table'),'Table'[amount]))``````

2. Result.

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thanks @v-yangliu-msft . This works as well.

Anonymous
Not applicable

@amitchandak You did get me completely and your measure works for me. Thanks

What would you suggest if I want the slicer to be reactive but, the row context is to be ignored? In other words, the measure returns the sum as per the selected slicer but the total amount does not change to the row context.

Super User

@Anonymous , Not sure I got you completely. Try like

Measure=Calculate(sum(table[amounts),Filter(all(table),Table[Year]="2020"))

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors