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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mcornfield
Helper III
Helper III

DAX Compare last 30 days with prior/previous 30 days before that

Hello, 

 

I am trying to create a DAX formula that lets me look at Rolling 30 days (from today) 

Then another Formula that looks at the Rolling 30 Days before that 

So I can Compare them.

I am looking at the Count of customers with Revenue Associated with them.

 

So far this is what i have:

1. Count of Cust w Rev = CALCULATE(DISTINCTCOUNT(Customers[CustomerName1]),FILTER(Transactions,Transactions[Revenue Net]>0))
 
2. Customers that Ordered in R30D = CALCULATE([1. Count of Cust w Rev],
DATESBETWEEN(Dates[Date],
MAX(Dates[Date])-30,
MAX(Dates[Date])))
 
I need to Build 
 
3. Customers that ordered Prior R30D =
 
4. %Chg
 
2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @mcornfield ,


Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

amitchandak
Super User
Super User

@mcornfield , Try like

 

Rolling 30 day = CALCULATE([1. Count of Cust w Rev],DATESINPERIOD('Date'[Date],max('Date'[Date]),-30,Day))

 

Rolling 30 before 30 day = CALCULATE([1. Count of Cust w Rev],DATESINPERIOD('Date'[Date],max('Date'[Date])-30 ,-30,Day))

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.