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
Anonymous
Not applicable

max in mesure over year equal to current month

hello,

 

What I try to do is, get the highest value of all month equal to the current month over all the years. 

 

2020 jan 11

2019 jan 5

2018 jan 8

2017 jan 13

2016 jan 5

In this case I would expect 13 as an output.

What I curenty have, will output in the same way as the table above:

 

highest =
var monthh = CALCULATE(count('Rol'[enddate]);MONTH(TODAY())=MONTH('Rol'[enddate]))
return
monthh
 
I've tried many diffrent things, either resulting in an error or a wrong value. 
Does anyone know how to achieve this within a single messure? 🙂
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

Highest =
MAXX (
    SUMMARIZE (
        'Rol',
        'Rol'[enddate].[Year],
        "C", CALCULATE (
            COUNT ( 'Rol'[enddate] ),
            MONTH ( TODAY () ) = MONTH ( 'Rol'[enddate] )
        )
    ),
    [C]
)

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

You need the max day, then why are you are doing count, did I got correctly?

var max_day = CALCULATE(maxx('Rol',day('Rol'[enddate]));all('Rol'[enddate]);MONTH(TODAY())=MONTH('Rol'[enddate]))

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

 

Anonymous
Not applicable

hey, thanks for your reply! 

The output is not what I expected 

enddate is the date a subscrition ends, so I want to count how many end each month. 

 

Then I want to know what the highest amount of enddates fell in January (the current month is jan), In this case I would expect 84 as an output:

2020 jan 12

2019 jan 43

2018 jan 16

2017 jan 84

2016 jan 36

 

I hope I made it a bit clearer?

 

 

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

Highest =
MAXX (
    SUMMARIZE (
        'Rol',
        'Rol'[enddate].[Year],
        "C", CALCULATE (
            COUNT ( 'Rol'[enddate] ),
            MONTH ( TODAY () ) = MONTH ( 'Rol'[enddate] )
        )
    ),
    [C]
)

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.