Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am facing an issue with DAX Total,
Here is my DAX
item cost for max date = var MaxDate = CALCULATE(MAX('Lookup Table'[transaction_date]),ALL('Lookup Table'[transaction_date])) RETURN
CALCULATE(SUMX('Lookup Table','Lookup Table'[Item Cost]),FILTER('Lookup Table','Lookup Table'[transaction_date] = MaxDate))
Look at this, It is getting only that value is on MAX date instead of a total of both product
Solved! Go to Solution.
Hi @Aazam
Please try
item cost for max date =
SUMX (
SUMMARIZE (
'Lookup Table',
'Lookup Table'[Item Code],
'Lookup Table'[Item Category],
'Lookup Table'[SKu],
'Lookup Table'[Location Name]
),
VAR MaxDate =
CALCULATE (
MAX ( 'Lookup Table'[transaction_date] ),
ALL ( 'Lookup Table'[transaction_date] )
)
RETURN
CALCULATE (
SUMX ( 'Lookup Table', 'Lookup Table'[Item Cost] ),
KEEPFILTERS ( 'Lookup Table'[transaction_date] = MaxDate )
)
)
I resolved it by myself
SUMX (
SUMMARIZE (
'Lookup Table',
'INV Sku'[sku],
'INV Categories'[name],
'INV Items'[item_code],
'INV Locations'[location_name]
),
VAR item_cost_for_max_date =
CALCULATE (
[item cost for max date]
)
VAR item_on_hand =
CALCULATE(
[Item_On_Hand_SUM]
)
RETURN
item_cost_for_max_date * item_on_hand
)
Hi @Aazam
Please try
item cost for max date =
SUMX (
SUMMARIZE (
'Lookup Table',
'Lookup Table'[Item Code],
'Lookup Table'[Item Category],
'Lookup Table'[SKu],
'Lookup Table'[Location Name]
),
VAR MaxDate =
CALCULATE (
MAX ( 'Lookup Table'[transaction_date] ),
ALL ( 'Lookup Table'[transaction_date] )
)
RETURN
CALCULATE (
SUMX ( 'Lookup Table', 'Lookup Table'[Item Cost] ),
KEEPFILTERS ( 'Lookup Table'[transaction_date] = MaxDate )
)
)
I have another question related to this,
Total_Cost_Max is the multiplication of item_cost_for_max_date and item_on_hand
I resolved it by myself
SUMX (
SUMMARIZE (
'Lookup Table',
'INV Sku'[sku],
'INV Categories'[name],
'INV Items'[item_code],
'INV Locations'[location_name]
),
VAR item_cost_for_max_date =
CALCULATE (
[item cost for max date]
)
VAR item_on_hand =
CALCULATE(
[Item_On_Hand_SUM]
)
RETURN
item_cost_for_max_date * item_on_hand
)
Thank you for the solution 🙂
Suggest me the learning material for DAXs
not sure why you are using sumx
item cost for max date =
var MaxDate = CALCULATE(MAX('Lookup Table'[transaction_date]),ALL('Lookup Table'[transaction_date]))
RETURN
CALCULATE(SUM('Lookup Table'[Item Cost]),FILTER('Lookup Table','Lookup Table'[transaction_date] = MaxDate))
Look at this, It is getting only that value is on MAX date instead of a total of both product
try afater the emasure
Total =
IF(HASONEVALUE([Item Code]),[Item Cost For Max Date] , SUMX(VALUES([Item Code]),[Item Cost For Max Date]))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |