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
manoj_0911
Advocate II
Advocate II

Assistance Needed: Creating Heatmap in Power BI

Hello Power BI Community,

 

I'm currently working on transitioning my reports from Tableau to Power BI, and I'm facing challenges with creating a heatmap similar to what I had in Tableau.

In Tableau, I successfully built a heatmap that visualized data effectively. However, when attempting to replicate the heatmap in Power BI, I encountered some difficulties with sorting the rows and columns correctly.

 

Tableau Heatmap Screenshots:
Screenshot - tableau - Heatmap -1.pngScreenshot - tableau -Heatmap -2.png

Power BI Heatmap Screenshot:
Screenshot Power BI - 10.pngScreenshot Power BI - 2.png

 

Tableau Heatmap Calculations:
Screenshot- tableau-Heatmap Fields.png

 

Power BI Heatmap Calculations:

-----------------------------------------

Weekday = WEEKDAY('IVR_SUBHOUR_V'[IXN_SUBHOUR_DATE], 2)

-----------------------------------------

Hour = HOUR('IVR_SUBHOUR_V'[IXN_SUBHOUR_DATE])

-----------------------------------------

Auth % = DIVIDE(SUM('IVR_SUBHOUR_V'[AUTH_COUNT]), SUM('IVR_SUBHOUR_V'[TOTAL_CALLS]), 0)

-----------------------------------------

Calls Transferred % = DIVIDE([Calls Transferred], SUM('IVR_SUBHOUR_V'[TOTAL_CALLS]), 0)
-----------------------------------------

Day_of_Week = FORMAT('AGENT_SUBHOUR_V'[IXN_SUBHOUR_DATE], "dddd")

-----------------------------------------

Day_of_Week_Order =
SWITCH(
'AGENT_SUBHOUR_V'[Day_of_Week],
"Sunday", 1,
"Monday", 2,
"Tuesday", 3,
"Wednesday", 4,
"Thursday", 5,
"Friday", 6,
"Saturday", 7,
0
)

-----------------------------------------

Hour_of_Day = HOUR('AGENT_SUBHOUR_V'[IXN_SUBHOUR_DATE])

-----------------------------------------

 

The main issue I'm experiencing in Power BI is with sorting the rows and columns properly. Specifically, I want the following ordering:

- Columns: From 12:00 AM to 11:00 PM
- Rows: From Sunday to Saturday (in this exact order)

However, despite my efforts, the rows and columns in Power BI are not sorting correctly according to my specifications.

Could you please provide guidance or suggestions on how to ensure the correct ordering of rows and columns in Power BI for the heatmap? Any insights or advice would be greatly appreciated.

Thank you for your assistance!

 

Best regards,
Manoj Prabhakar

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

Hi @manoj_0911 ,

1.Rows: From Sunday to Saturday

Since power bi sorts alphabetically by default, you need to create a new table to sort from Sunday to Saturday. Create a calculation table and write a dax expression:

True =

SUMMARIZE(

    'Table','Table'[Day Name],"min",MINX(FILTER(ALL('Table'),'Table'[Day Name]=EARLIER('Table'[Day Name])),[Day of Week]))

Select the Day Name column in the calculation table and set it to sort by the min column.

vkaiyuemsft_0-1708508759995.png

 

Create a relationship between the calculation table and the table you want to use so that you can use the Day Name of the calculation table to display the data correctly in the report.

vkaiyuemsft_1-1708508759997.png

2.Columns: From 12:00 AM to 11:00 PM

It is recommended that you create a new column identical to [IXN_SUBHOUR_DATE] and select the short time format in the format drop-down menu instead of using the hour function. This way power bi will sort by 12:00 AM to 11:00 PM by default.

vkaiyuemsft_2-1708508811596.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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-kaiyue-msft
Community Support
Community Support

Hi @manoj_0911 ,

1.Rows: From Sunday to Saturday

Since power bi sorts alphabetically by default, you need to create a new table to sort from Sunday to Saturday. Create a calculation table and write a dax expression:

True =

SUMMARIZE(

    'Table','Table'[Day Name],"min",MINX(FILTER(ALL('Table'),'Table'[Day Name]=EARLIER('Table'[Day Name])),[Day of Week]))

Select the Day Name column in the calculation table and set it to sort by the min column.

vkaiyuemsft_0-1708508759995.png

 

Create a relationship between the calculation table and the table you want to use so that you can use the Day Name of the calculation table to display the data correctly in the report.

vkaiyuemsft_1-1708508759997.png

2.Columns: From 12:00 AM to 11:00 PM

It is recommended that you create a new column identical to [IXN_SUBHOUR_DATE] and select the short time format in the format drop-down menu instead of using the hour function. This way power bi will sort by 12:00 AM to 11:00 PM by default.

vkaiyuemsft_2-1708508811596.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

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.