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

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

Reply
cristianml
Post Prodigy
Post Prodigy

Conditional column or dax expression if previous Month

Hi,

 

I nee to solve a condition. Not sure if this can be solved by creating a new column in the model.

I have millions of rows and dax expresions in my model. Assuming April'22 is the last month of my model I want to create a visual that can show me ONLY the NEW clients excluding the ones that were in last month.

 

In this case (as an example) the client 3 is the one that appears in the month (April) but wasn't in previous month. So I would need to consider only all those new ones:

cristianml_0-1653673972025.png

 

Aditional info if its needed:

Data table (CCMS Billings append)

cristianml_3-1653674714618.png

 

cristianml_5-1653674909467.png

 

cristianml_1-1653674620130.png

 

 

Model:

cristianml_4-1653674762761.png

 

 

Date table:

cristianml_2-1653674674110.png

 

 

Any ideas ? 

 

Thanks.

 

 

 

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@cristianml So, in theory something like:

Measure =
  VAR __MaxDate = MAXX(ALL('CCMS Billings append'),[Document Date])
  VAR __MaxYear = YEAR(__MaxDate)
  VAR __MaxMonth = MONTH(__MaxDate)
  VAR __LastDate = EOMONTH(__MaxDate,-1)
  VAR __LastYear = YEAR(__LastDate)
  VAR __LastMonth = MONTH(__LastDate)
  VAR __MaxClients = SELECTCOLUMNS(FILTER(ALL('CCMS Billings append'),YEAR([Document Date]) = __MaxYear && MONTH([Document Date]) = __MaxMonth),"__Client",[Master Client Name])
  VAR __LastClients = SELECTCOLUMNS(FILTER(ALL('CCMS Billings append'),YEAR([Document Date]) = __LastYear && MONTH([Document Date]) = __LastMonth),"__Client",[Master Client Name])
  VAR __Table = EXCEPT(__MaxClients, __LastClients)
RETURN
  //__Table contains list of clients that are in the current (max) month and not the month before.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

It gives an error:

cristianml_1-1653684319821.png

 

 

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.