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
jagostinhoCT
Post Partisan
Post Partisan

Calculate Min/Max and Count for each row

How to get a visual showing the MIN and MAX areas for each Apartment Code entry from the data in a table such as the one below?

 

Also, how do I format the %GT Area Apartment Code Total to show w/o decimal cases?

 

This is what I am aiming to do (fields in red are the ones I am trying to learn how to calculate)

 

Thanks in advance.

J

 

Apartment Code%GT Area Apartment Code TotalCount of Apartment CodeMIN AreaMAX Area
1 bed20.83%5142603
2 bed41.67%10140571
3 bed25.00%6123571
penthouse12.50%3400571

 

And this is what I have.

Apartment CodeArea
1 bed142.8353
1 bed300.4763
1 bed310.9436
1 bed372.24
2 bed140.3131
2 bed156.24
2 bed167.7358
2 bed171.4803
2 bed181.7823
2 bed243.7908
3 bed123.6074
3 bed400.2451
3 bed400.2451
3 bed405.3767
penthouse400.2451
penthouse405.3767
penthouse571.05
3 bed405.3767
3 bed571.05
2 bed303.8439
2 bed400.2451
2 bed405.3767
2 bed571.05
1 bed603.1788
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Use the format area on the Modeling tab to decrease the number of decimal places to 0. Hit the up arrow because it is probably set to Auto at the moment.

 

I believe that the two measures that you want are:

 

MIN Area = MIN(Table[Area])

MAX Area = SUM(Table[Area])

If you put those in a table along with your [Apartment Code] you should get what you want.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
v-xjiin-msft
Solution Sage
Solution Sage

@jagostinhoCT

 

In your scenario, you want to calculate the MAX or MIN areas for each Apartment Code group. Right?

 

To achieve your requirement, you can create calculated column with expression like:

 

Min Area =
CALCULATE (
    MIN ( 'Apartment Table'[Area] ),
    FILTER (
        'Apartment Table',
        'Apartment Table'[Apartment Code]
            = EARLIER ( 'Apartment Table'[Apartment Code] )
    )
)
MAX Area =
CALCULATE (
    MAX ( 'Apartment Table'[Area] ),
    FILTER (
        'Apartment Table',
        'Apartment Table'[Apartment Code]
            = EARLIER ( 'Apartment Table'[Apartment Code] )
    )
)

The result shows like this:

 

1.PNG

Thanks,
Xi Jin.

Greg_Deckler
Super User
Super User

Use the format area on the Modeling tab to decrease the number of decimal places to 0. Hit the up arrow because it is probably set to Auto at the moment.

 

I believe that the two measures that you want are:

 

MIN Area = MIN(Table[Area])

MAX Area = SUM(Table[Area])

If you put those in a table along with your [Apartment Code] you should get what you want.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

I do not think that the Modeling tab formatting applies to the % of Grant Total. See image below.

 

GT Percentage.png

 

 

The MIN and MAX work perfectly. So easy. So simple. Sometimes one gets bogged down with complicating things unnecessarily.

 

May thanks.

 

 

 

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.