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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amir_daee
Regular Visitor

different between filler(all(table), ...) vs filler(all(table[field]), ...) vs filler(table,...)

hi dears

i have some data link below:

power pivot 01.png

 

i want create comulitive total from diffrent form buy and sale columns.

when i create a measure with bellow dax formula it's ok:

 

Measure 1:=CALCULATE(SUMX(Table1,[buy]-[sale]),FILTER(all(Table1[tarikh]),[tarikh] <= MAX([tarikh])))

 

and the result like this:

power pivot 02.png

 

for the "a" product:

diff["139701"] = 20-0 = 20

diff["139702"] = 30-15 = 15

sum(diff) = 20+15 = 35

 

 

but when i use bellow formulas its wrang:

1- Table1 without [tarikh] the product not affect in result.

Measure 1:=CALCULATE(SUMX(Table1,[buy]-[sale]),FILTER(all(Table1),[tarikh] <= MAX([tarikh])))

power pivot 03.png

 

 

1- fillter whitout All the SUMX not affect in result.

Measure 1:=CALCULATE(SUMX(Table1,[buy]-[sale]),FILTER((Table1),[tarikh] <= MAX([tarikh])))

power pivot 04.png

 

what is diffrent between this formulas?

 

 

 

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @amir_daee

It involves the row context and filter context and depends on comulitive total of the grouping field in your visual.

 filler(table,...)  

it is meaningless that without all() in filter(table,...),

for it is always equal that [tarikh] and MAX([tarikh]) for current row

 

difference between filler(all(table),...)  and filler(all(table[field]),...) 

 depend on the expression after it.

all(table) will not affect by any fields except field in the expression after it.

and all(table[field]) will not affect by fields in all() and field in the expression after it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Take a look at these links, I would personally move your FILTER clause within your SUMX as the table value (first parameter).

 

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

Matrix Measure Total Triple Threat Rock & Roll

https://community.powerbi.com/t5/Quick-Measures-Gallery/Matrix-Measure-Total-Triple-Threat-Rock-amp-...

 

Measure Totals, The Final Word

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/td-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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