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.
hi dears
i have some data link below:
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:
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])))
1- fillter whitout All the SUMX not affect in result.
Measure 1:=CALCULATE(SUMX(Table1,[buy]-[sale]),FILTER((Table1),[tarikh] <= MAX([tarikh])))
what is diffrent between this formulas?
hi, @amir_daee
It involves the row context and filter context and depends on comulitive total of the grouping field in your visual.
it is meaningless that without all() in filter(table,...),
for it is always equal that [tarikh] and MAX([tarikh]) for current row
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
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
Measure Totals, The Final Word
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/td-p/547907
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |