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
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
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.