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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Stel
Helper I
Helper I

Maxx value returns sum instead of max value

 

Hi,

 

I want to show the max number of movements per hour in a card in the right upper corner.

As you can see, I currently get the value 377 as a result. This is fault because it's the sum of the Max values. 

Below in the table, the last column "max (per uur)" shows the max values. So in this case I want to show 79 as max value instead of 377.

 

I've tried with the following measures:

 

max_movements_per_hour =
MAXX (
SUMMARIZE(fact_location_inventory_transaction;dim_time[time_hour24];
"total";
COUNTROWS(fact_location_inventory_transaction));
[total]
)
 
And a second attempt:
max_movements_per_hour_v2 = MAXX(KEEPFILTERS(VALUES(dim_time[time_hour24])); [sum_movements])
 
But both gave the 377 as value instad of 79.
 

image.png

 

Can someone help me with this?

Thanks

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Stel,

I'd like to suggest you take a look at the following blog about measure total, it should suitable for your scenario:

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Stel 

The use of Summarize and count and max means count till this level(dim_time[time_hour24]) and then take max.

is this correct row context dim_time[time_hour24] ?

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak , I want the max movements per hour. The dim_time is a time table and the column [time_hour24] represents the hours in 24 format. Meaning 1, 2 ...24

So I would like to count all the rows of the fact_location_inventory_transaction in an hour. So number of rows with same value in time_hour24. And take the max of all the values calculated. Independent of from/to date selection.

 

For some reason at a certain point, I get the sum of the max values instead of max of max values.

 

My dim_date table and dim_time table are separate tables, linked to the fact_location_inventory_transaction table. Could that have something to do with it?

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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