Forum Discussion
How to Aggregate Values from a Dimension Table in a Donut Chart with Filter Context
- 1 year ago
Hi Tom_Herbet
Thank you for your thoughtful feedback. I'm glad the explanation around filter context and the use of TREATAS() helped clarify the issue.
To ensure model and visuals are functioning correctly, please verify that the columns used in TREATAS() such as fact_table[ITEM_NO] and Product_table[Item_parts_no] match in both data type and content. Also, confirm that slicers like Year, Dealer, Region, and Machine are based on fields from their respective dimension tables and are properly linked to the fact table.
This ensures filter context flows correctly into the fact table and then into the product table via the virtual relationship. When using the Fleet_Quantity_Filtered measure in visuals like donut charts, make sure the grouping field (e.g., Dealer or AREA_NAME) is part of a table that maintains a relationship with the fact table. For troubleshooting, start with a simple table visual using fields like Dealer, ITEM_NO, and the measure to validate logic and filter behavior. If issues persist, feel free to share more details about your visual configuration. I would be happy to assist .
Regards,
Karpurapu D.
You could use the fact table as a filter. This will expand to the product table, including any filters which are placed on the fact table, so only the relevant products will be included.
Regional_Fleet_Qty =
CALCULATE ( SUM ( Product_table[Fleet_quantity] ), fact_table )
Hi johnt75,
Thanks a lot for your reply and for suggesting a way to apply the fact table as a filter context in CALCULATE.
While this approach didn’t fully resolve my issue in this particular case, it reminded me how powerful context transition can be when used wisely and I’ll definitely keep this idea in mind for other modeling challenges.
I truly appreciate your help and the time you spent looking into this!
Best regards,
Tom_Herbet