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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Convert DAX to M (speed)

Hello everybody, 
 
I am trying to create a column which displays a boolean value based on the previous incident on the same object. If the created on date (of the incident) is within 30 days compared to the created on date of the previous incident, the value true must be showed. Based on this, we can conclude that the first fix was not good enough. 
 
I tied this by using DAX, and the formula below works good. However, with many rows (80.000), this takes a long time to calculate and I even end up in memory issues (warnings). Is there a better way to produce this value, for example by using M. I am not very skilled in M so if somebody would help me, this would be much appreciated. 
 
RepeatingVisit =
VAR PreviousVisit= CALCULATE(
MAX('(CRM) Incident'[created on]);
FILTER('(CRM) Incident';'(CRM) Incident'[created on] < EARLIER('(CRM) Incident'[created on]));
FILTER('(CRM) Incident';'(CRM) Incident'[objectid] = EARLIER('(CRM) Incident'[objectid]))
)

 

RETURN(
IF(PreviousVisit&& IF(PreviousVisit;
COUNTROWS(DATESBETWEEN(Datum[Date];PreviousVisit;'(CRM) Incident'[created on]))) < 30;true;false)
)
 
 
Example:
 

Created On         ObjectId             RepeatedVisit (expected output)

8-09-20181234false
15-09-2018432false
21-09-20181234true  (within 30 days, same object)
1-12-2018432false (same object, but not within 30 days)
2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous

 

Please post or share some data and the output expected to build a solution.

 

 

Cheers

 

CheenuSing

Anonymous
Not applicable

Hi @Anonymous

 

Thank you for your response. I updated the message and included an example of the data and expected output. I would love to hear from you how you would fix this. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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