Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
razieh12
Frequent Visitor

Matrix dynamic expansion

I've created a matrix within Power BI, with rows designated for months, weeks, and days, showcasing sales data. My goal is to enable expansion solely for the most recent month. From there, I desire only the last week of that month to be expandable, while keeping all other periods unexpanded. Importantly, I'm aiming for this behavior to be dynamic—no matter the updates to data or dates, the expansion setup should remain consistent as I've outlined.

razieh12_0-1693243506669.png

 

 

1 REPLY 1
Martin_D
Super User
Super User

Hi @razieh12 ,

 

You can do this with DAX measures. The "+" signs in front of the week rows will still appear, but no sublevel opens when clicking on it if you don't want to.


You can tweak the basic parent-child hierarchy DAX pattern to achieve this. For ragged hierarchies, preventing to show a sub-level needs to be done in DAX anyway, so you don't need to add a lot to make it dynamic. In the parent-child hierarchy pattern, the behavior of showing or not showing a sub-level is based on the pathlength (depth). But you can also make it based on a certain week or anything else. You just need to return blank for those days that shall not appear.

 

BR

github.pnglinkedin.png

Martin

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.