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

Dax Calculated Column

Need to display the previous month's dates and this month's dates by using the existing dates column.

 

Not basic filtering and advanced filtering.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Kumarun ,

 

Please check if the method @amitchandak provided could meet your requirements.

 

And just a little correction:

 

Flag =
SWITCH (
TRUE (),
[Date]
>= EOMONTH ( TODAY (), -2 ) + 1
&& [Date] <= EOMONTH ( TODAY (), 0 ), 1,
0
)

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @Kumarun ,

 

Please check if the method @amitchandak provided could meet your requirements.

 

And just a little correction:

 

Flag =
SWITCH (
TRUE (),
[Date]
>= EOMONTH ( TODAY (), -2 ) + 1
&& [Date] <= EOMONTH ( TODAY (), 0 ), 1,
0
)

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

=SWITCH (
TRUE (),
[date]
>= EOMONTH ( TODAY (), -3 ) + 1
&& [date] <= EOMONTH ( TODAY (), 0 ), FORMAT([date],"dd-mm-yyyy")
)

 

Display the date, so i'm using format function

amitchandak
Super User
Super User

@Kumarun , if you need a column, then you need create a flag

 

Flag =

Switch( True() ,

[Date] >=  eomonth(today(),-2) +1  && [Date] <= eomonth(today,0) , 1 , 0)

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

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.