Showing results for 
Search instead for 
Did you mean: 
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.

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

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors