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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors