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
Sea_and_Anne
Helper I
Helper I

Column- Max per month

Hello,

 

Hello,

I'm trying to add a column "MaxPerMonth" where i have the value max of the numberAlarms per month.

I've tried to use the function MAXX but i didn't get the required result, can you please help me?

 

 

DateNumberAlarmsMaxPerMonth
01-01-20162030
02-01-20162130
03-01-20162030
04-01-20163030
05-01-20161530
06-01-2016130
07-01-2016230
08-01-2016330
09-01-2016530
10-01-2016630
20-02-20165860
21-02-20166060
22-02-2016260
23-02-2016360
24-02-2016160
25-02-2016560
15-03-201615
16-03-201655
17-03-201615
18-03-20162

5

 

 

 

 

 

 

 

Thanks in advance for your help.

 

Mariana

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @Sea_and_Anne,

Firstly, create a new column named yearmonth using the following formula.

yearmonth = FORMAT(Table[Date],"yyyy/mm")


Secondly, create a new column named Maxpermonth using the following formula.

Maxpermonth = CALCULATE(MAX(Table[NumberAlarms]),FILTER(Table,Table[yearmonth]=EARLIER(Table[yearmonth])))

You will get your desired result as shown in the following screenshot. For more details, please review the example in the attached PBIX file.
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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

1 REPLY 1
v-yuezhe-msft
Employee
Employee

Hi @Sea_and_Anne,

Firstly, create a new column named yearmonth using the following formula.

yearmonth = FORMAT(Table[Date],"yyyy/mm")


Secondly, create a new column named Maxpermonth using the following formula.

Maxpermonth = CALCULATE(MAX(Table[NumberAlarms]),FILTER(Table,Table[yearmonth]=EARLIER(Table[yearmonth])))

You will get your desired result as shown in the following screenshot. For more details, please review the example in the attached PBIX file.
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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.

Top Solution Authors
Top Kudoed Authors