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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors