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
RadhaE
Frequent Visitor

Need help Dax query

Hi All,

 

I have a logic like below,

⦁ Pull all the invoices for Agency Bill policies that are hitting the GL (based on later of effective or entry date) during the report run period, e.g.
⦁ If an invoice is created in January 2021 but with an effective date of March 2021, then it should appear in the report for the month of March 2021.
⦁ If an invoice is created in February but with an effective date backdated to January 2021, then it should appear in the report for the month of February.

 

please help me how to create a dax function on the above logic.

 

Thanks in advance.

1 REPLY 1
amitchandak
Super User
Super User

@RadhaE , You need measure like

 


calculate(count(Table[Invoice]), filter(Table, Table[Type] = "Agency Bill" && eomonth([effective date], 0) = eomonth([report run period], 0)))

 

calculate(count(Table[Invoice]), filter(Table, eomonth(Table[invoice Date],2) = eomonth(Table[effective Date],0)))

 

calculate(count(Table[Invoice]), filter(Table, eomonth(Table[invoice Date],-1) = eomonth(Table[effective Date],0)))

 

 

The second and third is made generic using month gap

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.