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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kjcompton
Frequent Visitor

Multiple Queries to Make Dynamic Report

I am trying to make a dynamic report where my end user can select their specific columns that they want to report on, and we are doing this because if you select all the columns you are looking at 60+ columns and it makes the report hard to look for data. Here are the steps that I have done. 

1. I did was I made a table with all the columns that are available/what the requester would like to report on, and I grouped them in categories as shown below:

kjcompton_0-1663167696997.png

2. After I did this I brought that into a Hierarchy Slicer (as this will allow pick and choose of columns). 

kjcompton_3-1663168138625.png

 

3. I then took all my separate queries (6) and unpivoted them so they could all relate to my main table (here is the linkage)

kjcompton_1-1663167833440.png

4. I then brought in a matrix table, but the issue here is each query that I unpivoted now has its own CaseID/EncounterID under the "rows" section of the matrix, under columns I had to bring in 6 different "originalcolumnnm" and under values I brought in the six different "first values", but the out put doesn't work. It just says "first value" across the top.

kjcompton_2-1663168051613.png

My question is how do I make this interactive and show the columns that I need with all these different queries? I feel there has to be an easier way... I appreciate everyone's help with this!

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @kjcompton ,

 

According to your statement, I think you only add columns into matrix column field and value field. I think you need to expand your matrix by adding columns in matrix row field.

I think your data table should look like an unpivot table. I suggest you to add an index before your unpivot or add an index by group after unpivot.

For refernece:

Add an index column

Create Row Number for Each Group in Power BI using Power Query

Your table should look like as below.

RicoZhou_0-1663223180655.png

Matrix is as below.

RicoZhou_1-1663223584557.png

 

 

Best Regards,
Rico Zhou

 

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

 

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @kjcompton ,

 

According to your statement, I think you only add columns into matrix column field and value field. I think you need to expand your matrix by adding columns in matrix row field.

I think your data table should look like an unpivot table. I suggest you to add an index before your unpivot or add an index by group after unpivot.

For refernece:

Add an index column

Create Row Number for Each Group in Power BI using Power Query

Your table should look like as below.

RicoZhou_0-1663223180655.png

Matrix is as below.

RicoZhou_1-1663223584557.png

 

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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