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
manuelbanza
Frequent Visitor

Average of Min

Hi,

 

I have this dataset for example:

HotelDayPrice
A1 €   150.00
A1 €   130.00
A1 €   200.00
B1 €   150.00
C1 €   145.00
C1 €   135.00
D1 €   200.00
D1 €   190.00
A2 €   190.00
B2 €   160.00
B2 €   120.00
C2 €   120.00
C2 €   178.00
D2 €   170.00


So for each day I have Hotels with different prices (different rooms). What I want to do is to calculate the average by hotel of their lowest rate. First calculate the MIN value for each hotel by day and then create the average of those days (in this example day 1 and 2. So then I can have a graph like this:


price.PNG

 

 

Or maybe create a column that only return the lowest price for each hotel and the other rows return 0, and then I can create an average of that column excluding zeros.

 

I have tried a lot of calculations but none of them seem to work. Can you help me with this?

 

Thank you!

 

Manuel Banza

1 ACCEPTED SOLUTION
Cesare
Regular Visitor

Try this:

 

AvgOfMin = AVERAGEX(SUMMARIZE(Table1,Table1[Day],"MinPrice",MIN(Table1[Price])),[MinPrice])
 
Note that the price needs to be Numeric.
 
Cesare

View solution in original post

3 REPLIES 3
Cesare
Regular Visitor

Try this:

 

AvgOfMin = AVERAGEX(SUMMARIZE(Table1,Table1[Day],"MinPrice",MIN(Table1[Price])),[MinPrice])
 
Note that the price needs to be Numeric.
 
Cesare

@Cesare Thank you so much it works perfectly!

 

Have a nice weekend.

 

Manuel Banza

hi @Cesare 

 

do you know I can calculate the mode of the min(Lowest price)?

 

thank you,

 

Manuel Banza

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.