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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anupahwa
Regular Visitor

Dax

Hi , I am new to this field . My requirement is to optimize the measure which I am using in my model . 

Projected EFT Bi_ Monthly Date =
VAR maxdate =
MAX ( 'DATE TABLE'[FullDate] )
VAR mindate =
MIN ( 'DATE TABLE'[FullDate] )
VAR selected_dates =
VALUES ( 'DATE TABLE'[DayOfMonth] )
VAR Billingdatenotblank =
CALCULATETABLE (
'Member Recurring Service',
FILTER (
'Member Recurring Service',
( 'Member Recurring Service'[frequency] = "Bi-Monthly"
&& 'Member Recurring Service'[recurringServiceStatus] = "Active" )
&& 'Member Recurring Service'[recurringServiceSubStatus] <> "Frozen"
&& 'Member Recurring Service'[firstBillingDate] < maxdate
|| ( ( 'Member Recurring Service'[inactiveDate] + 30 ) > maxdate )
&& 'Member Recurring Service'[frequency] = "Bi-Monthly"
&& 'Member Recurring Service'[firstBillingDate] < maxdate
)
)
VAR MRS_BiMonthly =
SUMMARIZE (
Billingdatenotblank,
[member_Key],
[firstBillingDate],
[invoiceTotal],
"Projections",
VAR mk = [member_key]
VAR fd =
DAY ( [firstBillingDate] )
VAR day2 =
IF ( fd < 16, fd + 15, fd - 15 )
VAR Intersect_ =
MINX (
FILTER (
'DATE TABLE',
'DATE TABLE'[DayOfMonth] = fd
|| 'DATE TABLE'[DayOfMonth] = day2
),
'DATE TABLE'[FullDate]
)
RETURN
MINX ( FILTER ( Billingdatenotblank, [member_Key] = mk ), Intersect_ )
)
RETURN
MINX ( MRS_BiMonthly, [Projections] )

 

 

This is my dax .I am calculating the projected dated based on the frequency . Now I want to optimize this measure .since the MRS table filters are same for the frequency weekly , bi weekly  etc.

 

 

So I want to store this cLxulatable ( MRs ....) part so that I can reuse them in other measure. 

 

 I have searched got to know about the details row expression. I have created this in tabular editor but am not getting the result . Can anyone please help me 

2 REPLIES 2
Anupahwa
Regular Visitor

Hi @Greg_Deckler . This is a measure .My boss wants me to use detailrow function . He does not want me to use the same  filter again and again in other measures as the filters of " MRS" are same . I read about detailrows .created the expression in tabular editor but I am unable to use it in my model don't know where I am going wrong 

Greg_Deckler
Super User
Super User

@Anupahwa Can you share the PBIX so that we can test out performance optimization improvements to see if they help or not. How long is this measure taking currently?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.