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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
kbauro97
New Member

Database design and modeling

Hi, 
I want to create a dashboard where I would have a matrix with the categories divided per date and its chart per date and value.
For example, I would have a table with the countries, then I would find the cities, and then the division per indicators. 

kbauro97_1-1643089225740.png


I have two options. In the first table, I have in the first column the date and the next columns the values for Country/City/Indicator combination. I will have many combinations and I want to have all the values from all the year in the table. 

 

CountryMexicoMexicoUSAUSA
CityCdmxCdmxNYCNYC
IndicatorPeopleQualityPeopleQuality
01-01-221001015010
02-01-222002025020
03-01-223001035010
04-01-224002045020
05-01-225001055010
06-01-226002065020
07-01-227001075010
08-01-228002085020

Vertical


In the second option, I have the categories in columns (country, city, indicator) and one date per column.

CountryCityIndicator01-01-2202-01-2203-01-2204-01-2205-01-2206-01-2207-01-2208-01-22
MexicoCdmxPeople100200300400500600700800
MexicoCdmxQuality1020102010201020
USANYCPeople150250350450550650750850
USANYCQuality1020102010201020

Horizontal

 

Which database design should I use in order to have the dates- country/city/indicator matrix table?

How can I create the data model in order to use a matrix chart?

I hope you can help me to solve this issue. Thank you.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@kbauro97 , You have to unpivot the tables and bring city and date on rows.

 

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Then create common dimensions like city and date join with both tables and use those

View solution in original post

v-jayw-msft
Community Support
Community Support

Hi @kbauro97 ,

 

The second one. Open query editor and selecte the first three columns and use unpivot other columns feature.

1.PNG

Then you will get a table like below and you will be able to create matrix the visual that you wanted.

2.PNG3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
kbauro97
New Member

Thank you. I didn't know that feature, it is really helpful

v-jayw-msft
Community Support
Community Support

Hi @kbauro97 ,

 

The second one. Open query editor and selecte the first three columns and use unpivot other columns feature.

1.PNG

Then you will get a table like below and you will be able to create matrix the visual that you wanted.

2.PNG3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@kbauro97 , You have to unpivot the tables and bring city and date on rows.

 

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Then create common dimensions like city and date join with both tables and use those

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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