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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bramgoos
Regular Visitor

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors