Forum Discussion
Dax Formula correction help
- 7 months ago
Hello! The issue lies in your tot_val variable. By using ALL(Inventory_stock_dtl), you are telling Power BI to ignore every single filter on that table, which is why your Division, Category, and Item filters are being ignored.
To calculate the total across all aging buckets while keeping your other slicers active, you should replace ALL with ALLEXCEPT or specifically remove the filter only from the Ageing Bucket column.
Try updating your tot_val variable to this:
var tot_val =
CALCULATE(
SUM(Inventory_stock_dtl[Value]),
ALLEXCEPT(
Inventory_stock_dtl,
Inventory_stock_dtl[Stock_fin_year],
Inventory_stock_dtl[Month_sorter],
Inventory_stock_dtl[div_name],
Inventory_stock_dtl[item_category],
Inventory_stock_dtl[item
]
)
)
Alternatively, a cleaner way using REMOVEFILTERS:
var tot_val =
CALCULATE(
SUM(Inventory_stock_dtl[Value]),
REMOVEFILTERS(Inventory_stock_dtl[Ageing_Bucket_Column_Name]), -- Replace with your actual bucket column name
Inventory_stock_dtl[Stock_fin_year] = FinalYear,
Inventory_stock_dtl[Month_sorter] = FinalMo
nth
)
Why this works:
ALLEXCEPT: It clears all filters except for the ones you list. By listing Year, Month, Division, and Category, those filters stay active while the "Ageing Bucket" filter is cleared to get the grand total.
REMOVEFILTERS: This is the modern way. It only removes the filter from the specific "Ageing Bucket" column, allowing all other slicers (Division, Item, etc.) to continue affecting the total.
I hope this helps you get that 100% total! If this resolves your issue, please mark this post as an "Accepted Solution." Happy New Year!
Best regards,
Vishwanath
Hi JothiG,
Thank you AshokKunwar krishnakanth240 danextian LED_General for your responses to the query.
we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!
- AshokKunwar7 months agoContinued Contributor
your thankfull
If this solves your issue, please mark this as an "Accepted Solution" to help others in the community.
Best regards,
Vishwanath