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
newbieNG
Regular Visitor

Migration of Tableau Dashboard to PowerBI , issue with a measure

Hello Community , I am migrating a tableau dashboard to PowerBi dashboard. I am stuck with few of the measures of Tableau that I am finding tricky to write in DAX. 

One of the measure is :

{ FIXED DATEPART('weekday', [Start Time]), DATEPART('hour', [Start Time]): AVG(
{ FIXED DATETRUNC('day', [Start Time]), DATEPART('weekday', [Start Time]), DATEPART('hour', [Start Time]):
COUNTD([Warehouse Name])}
)}

I came up with this DAX expression 

Avg Warehouses on During this hour =
AVERAGEX (
SUMMARIZE ( WAREHOUSE_METERING_HISTORY, WAREHOUSE_METERING_HISTORY[START_TIME].[Day] ),
CALCULATE (AVERAGE( WAREHOUSE_METERING_HISTORY[Time] ) )
)
But this is not giving me the desired result . I am supposed to calculate a Total number of hours of warehouse at certain day at certain hour. 
I am attaching the graph of tableau that I am working to recreate in PowerBI
newbieNG_1-1651172593445.png

If anyone has done this or can help me understand & write this expression will be helpful.

Thank you

 

 

3 REPLIES 3
newbieNG
Regular Visitor

Thank you, Chenwu zhu for replying! By "field name " you mean column or what. I didn't get it , can you please elaborate that can help me to understand a little better. 

Thanks

Hi @newbieNG ,

 

The name given to a total or summarize column, enclosed in double quotes.

Please refer this link.

SUMMARIZE function (DAX) - DAX | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

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

v-chenwuz-msft
Community Support
Community Support

Hi @newbieNG ,

 

Avg Warehouses on During this hour =
AVERAGEX (
SUMMARIZE ( WAREHOUSE_METERING_HISTORY, WAREHOUSE_METERING_HISTORY[START_TIME].[Day] ),"field_name",
AVERAGE( WAREHOUSE_METERING_HISTORY[Time] ) 
)
 
You had missed one argument which i high light in red.
 

Best Regards

Community Support Team _ chenwu zhu

 

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.