cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iioannou Regular Visitor
Regular Visitor

Custom Column help

Hello,

 

I have the following custom column

Occupancy % MTD = SUM('Rooms'[Occupancy %]) / 'Almyra Rooms'[StatisticDateDay]

 

I would like to SUM all rows that have the same month and same year only and not all the records. Then I would be able to devide it by the date of the month and I should get the MTD...

 

For example, this is what I have in mind...

Occupancy % MTD = SUM('Almyra Rooms'[Occupancy %] #WHERE MONTH NAME#) / 'Almyra Rooms'[StatisticDateDay]

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Custom Column help

Hi iioannou ,

 

Try this DAX formula:

 

Occupancy % MTD =
CALCULATE (
    SUM ( 'Rooms'[Occupancy %] ),
    FILTER (
        Rooms,
        YEAR ( Romms[date] ) = YEAR ( EARLIER ( Romms[date] ) )
            && MONTH ( Romms[date] ) = MONTH ( EARLIER ( Romms[date] ) )
    )
)
    / 'Almyra Rooms'[StatisticDateDay]

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Custom Column help

Hi iioannou ,

 

Try this DAX formula:

 

Occupancy % MTD =
CALCULATE (
    SUM ( 'Rooms'[Occupancy %] ),
    FILTER (
        Rooms,
        YEAR ( Romms[date] ) = YEAR ( EARLIER ( Romms[date] ) )
            && MONTH ( Romms[date] ) = MONTH ( EARLIER ( Romms[date] ) )
    )
)
    / 'Almyra Rooms'[StatisticDateDay]

Regards,

Jimmy Tao

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors