Forum Discussion
Matrix
- 1 year ago
Hi wwenw1,
Thanks for reaching out to the Microsoft fabric community forum.
To show values in a Power BI matrix only when a user expands to a lower-level detail, you can use the ISINSCOPE() function inside a measure to dynamically control visibility.
If your hierarchy is Category → Subcategory → Product, and you want values to appear only at the Product level.
Here is the DAX : Visible Sales
IF (
ISINSCOPE(SalesData[Product]),
SUM(SalesData[Sales]),
BLANK()
)Use this measure in the matrix’s Values field instead of the raw sales column. This will ensure that higher levels (Category and Subcategory) show blank values when collapsed, and only show data when the user drills down to Product.
If you instead want values to be shown at both the Subcategory and Product levels, you can modify the measure like this:
Here is the DAX : Visible Sales Alt
IF (
ISINSCOPE(SalesData[Subcategory]) || ISINSCOPE(SalesData[Product]),
SUM(SalesData[Sales]),
BLANK()
)Please find the attached pbix file for your reference.
If the response has addressed your query, please "Accept it as a solution" and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support