cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bramgoos
New Member

Need DAX help to setup dynamic DATEDIFF dax formula

Per specific moment in time I would like to segmentate the client base in 4 groups based on the total days they are client (< 365 days, between 366 and 730 day, etc). The calculations of the total days is: days between the registration date and [x].

 

I'm struggling to make a dax formula that shows snapshots of the client base in the past while using the DATEDIFF formula for segmentation.

 

I started with an additional column to calculate the days: datediff = if(ISBLANK(X[Member until]),0,datediff(X[Registration date],now(),day). However, the date is not dynamic. A possibility is to create many additioanl columns with x, x-1, x-2 etc.  However, there should be a more easy solution. 

 

Can someone help me to get the following calculations in place?

  XX-1x-2
 <=365 days..count members where datediff(registration_date, x-1) <= 365count members where datediff (registration_date, x-2) <= 365
 between 366 days and 730 days..count members where datediff(registration_date, x-1) between 366 and 730count members where datediff(registration_date, x-2) between 366 and 730
 between 731 days and 1091 days.......
> 1092 days......

 

X = Registration date (per week/month)

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

If you don't get answers... well, that means people do not understand your requirements. Please make them clearer.

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors