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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
CarlEThinggaard
Frequent Visitor

Multiple inputs/slicers to a matrix table using SWITCH(TRUE()

I have an issue with creating my matrix table, as I want to dynamically change both the rows and columns based on two slicers from two separate tables. I would like the matrix to contain date dimensions as rows, so I have made a filter containing date, quarter, year etc. On the columns I would like date intervals such as 2 hour, 4 hour and 8 hour intervals. I have created an according slicer to this as well.

I have been able to do this in Import mode using Field Parameters, and I am trying to make the same functionality using Direct Query.

At the same time I will like to change between measures in the matrix, therefore I have made a measure using SWITCH(TRUE(), to switch between the measures given the selection in a slicer.

All of this has worked fine so far when making a line chart for example, as I only needed input for the X-axis while doing this. But on the matrix I have an issue with writing the DAX, that will allow me to give input both from the date and the time-interval slicer on the same time.

I have managed to write the DAX so that one of the slicers will work and distribute the values, see below where the rows (dates) works, but the values are not distributed on the time intervals.

CarlEThinggaard_0-1704800832605.png

 

Any help is much appreciated.

1 REPLY 1
Anonymous
Not applicable

Hi @CarlEThinggaard ,

Can you give me some sample data and expected results, thank you

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.