Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kannanAhammed
Helper IV
Helper IV

Get next month based on status

Hi All,

 

I would like to get next month from a column "Modified" (which is of date data type). if the status column is "Completed".

 

something like this.

MeasureNextmonth = if (status == 'Completed')

{

NEXTMONTH('Tablename'[Modified])

}

 

also in dax function i can only access measure colums. How do i write expressions based on default columns loaded during transformation stage

1 ACCEPTED SOLUTION

HI  @kannanAhammed 

This formula will work for a new column, if you want to create a measure, you need to adjust it as below:

Measure Nextmonth = IF (MAX(Tablename[status]) = "Modified", EOMONTH(MAX(Tablename[Modified]),0)+1 , EOMONTH(MAX(Tablename[Modified]),-1)+1)

 

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

https://radacad.com/measure-vs-calculated-column-the-mysterious-question-not

 

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

6 REPLIES 6
amitchandak
Super User
Super User

@kannanAhammed , not very clear, Measure would be like

if (max(status) = 'Completed',NEXTMONTH('Tablename'[Modified]),blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nvprasad
Solution Sage
Solution Sage

Hi,

 

Try below measrue

 

Measure Nextmonth = IF (Status = "Modified",  EOMONTH(H10,0)+1 , EOMONTH(H10,-1)+1)

 

This gives next month first date by defualt and you can use format function to get desired format.

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Thank you,

 

Measure Nextmonth = IF (Status = "Modified",  EOMONTH(H10,0)+1 , EOMONTH(H10,-1)+1)

But i am not able to type "Status" its only accepting Measure column not other colum to be added in the IF expression.

HI  @kannanAhammed 

This formula will work for a new column, if you want to create a measure, you need to adjust it as below:

Measure Nextmonth = IF (MAX(Tablename[status]) = "Modified", EOMONTH(MAX(Tablename[Modified]),0)+1 , EOMONTH(MAX(Tablename[Modified]),-1)+1)

 

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

https://radacad.com/measure-vs-calculated-column-the-mysterious-question-not

 

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.

Thank you, it worked

 

few doubts,

1) Max() return the largest value. How is this working in this expression. 

2) when i tried using existing column in expression the fornula always shows error. but when i use it inside max column it worked.

 

please excuse my English as its not my first language.

hi  @kannanAhammed 

 Measure is a summary value by its row context in a visual, so MAX/MIN has the same logic.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

 

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.