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
charlyrosero
Frequent Visitor

Select max month bewteen actual and budget columns

Hi!

  

Nowadays I need to always identify what is the last month of data for the current values. The following example shows the dataset that I have.

 

Month      Actual        Budget

January      100             90 

Febrary      200             120

March        60               220

June          180             150  --> i need to identify always this month

July                               100

August                          101

 

I appreciate any help

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@ charlyrosero

After my research , you can do these like below:

Step 1:

If column Month data type is not date ,you need to add a column that trans month in column Month into number like below:

Month No = IF(Table5[Month]="January",1,IF(Table5[Month]="Febrary",2,IF(Table5[Month]="March",3,IF(Table5[Month]="April",4,IF(Table5[Month]="May",5,IF(Table5[Month]="June",6,IF(Table5[Month]="July",7,
IF(Table5[Month]="August",8,IF(Table5[Month]="September",9,IF(Table5[Month]="October",10,IF(Table5[Month]="November",11,IF(Table5[Month]="December ",12)))))))))))) 

Step 2:

Add this Measure

Measure = CALCULATE(MAX(Table5[M]),FILTER(Table5,ISBLANK(Table5[ Actual ])=FALSE()&&ISBLANK(Table5[Budget])=FALSE() ))

Result:

17.png

 

Best Regards,

Lin

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

Hi@ charlyrosero

After my research , you can do these like below:

Step 1:

If column Month data type is not date ,you need to add a column that trans month in column Month into number like below:

Month No = IF(Table5[Month]="January",1,IF(Table5[Month]="Febrary",2,IF(Table5[Month]="March",3,IF(Table5[Month]="April",4,IF(Table5[Month]="May",5,IF(Table5[Month]="June",6,IF(Table5[Month]="July",7,
IF(Table5[Month]="August",8,IF(Table5[Month]="September",9,IF(Table5[Month]="October",10,IF(Table5[Month]="November",11,IF(Table5[Month]="December ",12)))))))))))) 

Step 2:

Add this Measure

Measure = CALCULATE(MAX(Table5[M]),FILTER(Table5,ISBLANK(Table5[ Actual ])=FALSE()&&ISBLANK(Table5[Budget])=FALSE() ))

Result:

17.png

 

Best Regards,

Lin

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