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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alkhos
Advocate I
Advocate I

Create Multiple Heatmaps in Power BI

Hello,

 

I have a question regarding creation of heatmaps in Power BI.

Assume that I have a dataset with the following four columns:

 

date   srcLocation  dstLocation   Value

 

The goals is to create heatmap for each date that is seen in the data. Here are the steps that I believe should be followed, and need some reference / help on either one:

 

1. Slice the data based on date, i.e. create a dataset for each unique date in the dataset

2. For each slice, transform the flat data into a matrix, i.e. column names should be srcLocation and row names should be destLocation and values should appear for each pair

3. Plot a heatmap that is sliced for each of the above matrices. Ideally, user can choose a date and see its heatmap.

 

Are there ways to achieve 1 and 2?

For 3, is the only way to create a visual in R? or does PBI have some heatmap visuals already?

 

1 ACCEPTED SOLUTION

Hi @Alkhos,

 

In your scenario, you can use Treemap to display values like the matrix, and place Date field within the slicer visual to filter Treemap data. See:

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @Alkhos,

 

1. Slice the data based on date, i.e. create a dataset for each unique date in the dataset

 

You can open Query Editor, right click the column [date] and select Remove Duplicates. Back to the report, place [date] in a slicer visual.

 

q1.PNG

 

2. For each slice, transform the flat data into a matrix, i.e. column names should be srcLocation and row names should be destLocation and values should appear for each pair

 

You can just drag a matrix visual to the report page which has slicer visual, then place [srcLocation] in Columns and [destLocation] in Rows.

 

3. Plot a heatmap that is sliced for each of the above matrices. Ideally, user can choose a date and see its heatmap.

 

There is a custom visual named Table Heatmap, you can download from Visuals Gallery.

 

Best Regards,
Qiuyun Yu

 

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

Thanks @v-qiuyu-msft,

 

Steps 1 and 2 seems trivial, but I am confused on how to pass the matrix to the heatmap.

Ideally, I want to pass a dataset with the format similar created in step 2 to the "Table Heatmap" visual that you mentioned; however, the matrix is in my visuals not in query editor. Is there a way to send back these matrices to the available data so that they can be consumed by step 3?

 

Thanks

Ali

Hi @Alkhos,

 

Can you share some sample data and expected data table? So that we can check whether we can achieve it in Query Editor.

 

Best Regards,
Qiuyun Yu

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

Hi @v-qiuyu-msft

 

Here is some sample data:

 

Untitled.png

 

So I deally I want to have a heatmap ( similar to the matrix visual ) that has src for the rows and dest for the columns and average of values for all dates at the intersection points ( actually if matrix visual had conditional formatting like the table, it would have done the trick ). Then I want to have a slicer that can be used to filter (avergae) data for (a) specific day(s)

 

Bests

Ali

Hi @Alkhos,

 

In your scenario, you can use Treemap to display values like the matrix, and place Date field within the slicer visual to filter Treemap data. See:

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Alkhos
Advocate I
Advocate I

Hello,

 

I have a question regarding creation of heatmaps in Power BI.

Assume that I have a dataset with the following four columns:

 

date   srcLocation  dstLocation   Value

 

The goals is to create heatmap for each date that is seen in the data. Here are the steps that I believe should be followed, and need some reference / help on either one:

 

1. Slice the data based on date, i.e. create a dataset for each unique date in the dataset

2. For each slice, transform the flat data into a matrix, i.e. column names should be srcLocation and row names should be destLocation and values should appear for each pair

3. Plot a heatmap that is sliced for each of the above matrices. Ideally, user can choose a date and see its heatmap.

 

Are there ways to achieve 1 and 2?

For 3, is the only way to create a visual in R? or does PBI have some heatmap visuals already?

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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