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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mazwro
Helper II
Helper II

manipulation of 'last' dates and 'previous ' dates

I have a table like this in power BI. There is a client email and dates that this email transacted.

How can I get it to a format like this:

 

I need to figure out logic like this:

- client transacted in last 3 months

- client transacted in 3 months prior to last 3 month

I think two columns would do

 

mazwro_0-1723542934287.png

 

1 ACCEPTED SOLUTION
DatawithDinesh
Resolver II
Resolver II

You can create two columns, with the following dax, I'm assuming that date_order is the transaction date for the client email on which the calculation will be based on.

Last3Months = 
IF(
    [date_order] >= TODAY() - 90 && 
[date_order] <= TODAY(),
    1,
    0
)
_________________________________________________________________________


Prior3Months = 
IF(
    [date_order] >= TODAY() - 180 && [date_order] < TODAY() - 90,
    1,
    0
)

View solution in original post

1 REPLY 1
DatawithDinesh
Resolver II
Resolver II

You can create two columns, with the following dax, I'm assuming that date_order is the transaction date for the client email on which the calculation will be based on.

Last3Months = 
IF(
    [date_order] >= TODAY() - 90 && 
[date_order] <= TODAY(),
    1,
    0
)
_________________________________________________________________________


Prior3Months = 
IF(
    [date_order] >= TODAY() - 180 && [date_order] < TODAY() - 90,
    1,
    0
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors