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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Count from last day of the month

 

Hi there all,

 

I have a question about a DAX formula. Probably very simple but I can't figure it out.

I have a data set with financial data. Every line in my dataset stands for 1 payment. The data concerns declarations of care provided.

 

The 'Dat_Begin' field shows the date on which the performance was delivered. This date differs from the date on which payment was made. This is because healthcare is often claimed with retroactive effect.

Well I would like to make a graph with the development of costs. However, because the care is billed retroactively, I do not want to show the last 3 months (for example, dat_begin) in the graph. This is because otherwise the graph always expires enormously at the end of the period. This therefore gives a distorted picture. After 3 months, most declarations are received.

 

What do I want:
I want to make a formula that goes back 3 months from the last day of the previous month.

Example: today is 30-09-2019, so I want the date 31-05-2019 to be returned.
If I look again tomorrow (1-10-2019), then the formula should return 30-06-2019. Also on, for example, 15-10-2019 the formula must still return 30-06-2019.

 

Who can help me? Thank you very much in advance!

1 ACCEPTED SOLUTION
sarjensystems1
Helper III
Helper III

try this
Measure = ENDOFMONTH(DATEADD(Query1(pk_Date),-4,MONTH))

View solution in original post

4 REPLIES 4
sarjensystems1
Helper III
Helper III

try this
Measure = ENDOFMONTH(DATEADD(Query1(pk_Date),-4,MONTH))
Anonymous
Not applicable

This did the job! Thxs both!

 

Measure = ENDOFMONTH(DATEADD(Query[DAT_BEGIN];-3;MONTH))
Anonymous
Not applicable

Hi,

 

You should be able to use the below DAX Code.

 

Measure:= EOMONTH(Table[Date],-4),

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

Anonymous
Not applicable

Thxs, but didn't did the job.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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