Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
maciekimirekk
Frequent Visitor

Impact of FILTER and ALL function

Hi,

 

I have created two basics measures:

 

1. noFILTER = CALCULATE(
    count(Dane[order_id]),
    month(Dane[order_date]) = 9
    )
 
2. 
withFILTER = CALCULATE(
    count(Dane[order_id]),
    Filter(
        ALL(
            Dane[order_date]),
            MONTH(Dane[order_date] = 9)
    ))
 
I expect that the measure "nofilter" will change when I choose a different month, however, "withFilter" should remain the same as "FILTER" function ignores any other filters. However, it's not working in this way, so where I do the mistake in functions/my understanding of "FILTER" / "ALL" function. 
 
maciekimirekk_1-1704831518563.png
maciekimirekk_2-1704831582564.png

 

THank you in advance.

 

Br,

 

Maciej

 


 

4 REPLIES 4
gadielsolis
Resolver III
Resolver III

Hello @maciekimirekk .

 

I would like to propose the following solution:

 

I just created the following table to use it as example:

gadielsolis_0-1704832928398.png

 

Then my solution would be the following:

 

1-Create a new table with the months (You can use Summarize to get this data). This table will not be conected to the original one, we will use this calendar in the slicer.

gadielsolis_1-1704832958883.png

 

2-Create a slicer with the new calendar table

gadielsolis_2-1704833022908.png

 

3-Create the following measures:

Sum of data =
        SUM('Table'[Data])

 

Lets say we want to keep Apr in the graph.

Filtered =
        CALCULATE([Sum of data],FILTER('Table','Table'[Month]="Apr"))
 
Measure to show the second Bar:
No Filter =
        IF(MAX('Table'[Month])=SELECTEDVALUE('Calendar'[Month]),CALCULATE([Sum of data],'Table'[Month]=SELECTEDVALUE('Calendar'[Month])))
 
gadielsolis_7-1704833144398.pnggadielsolis_8-1704833150749.pnggadielsolis_9-1704833158236.pnggadielsolis_10-1704833167107.png

Whit this you'll be able to change the dark blue bar by clicking on the slicer and the other one will show the same value.

 

Please let me know if this works for you.

 

 

Fowmy
Super User
Super User

@maciekimirekk 

These two measures are the same, when you include your filter within calculate as "MONTH(Dane[order_date] = 9)", it actual is converted to " FILTER ( ALL( Dane[order_date]),  MONTH(Dane[order_date] = 9) )" in the backend.





Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy Thanks. So what's the point of using that if the calculation is done in the background?

@maciekimirekk 

I would like you to read the following article with reagrds to your question:

Simple Filters and Syntax Sugar in DAX functions - Excelerator BI
Specifying multiple filter conditions in CALCULATE - SQLBI



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors