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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ryan012620
New Member

EOMonth use the filter date instead

Can someone help me with this DAX.

 

CALCULATE(SUM('Leasing Metrics'[Future Occupancy]),'Leasing Metrics'[Date]=EOMONTH('Leasing Metrics'[Date],-1)+1)/CALCULATE(SUM('Leasing Metrics'[Total Units]),'Leasing Metrics'[Date]=EOMONTH('Leasing Metrics'[Date],-1)+1)
 
Instead of using 'Leasing Metrics'[Date] for EOMONTH, I need to use the 'Date'[Date] which is being use as a filter.
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @ryan012620 ,

 

Your request is too vague. I hope you can provide me with sample data and expected results. Do not take screenshots. Please remember to erase sensitive data. It would be better if you can provide the pbix file. Remember not to log in to your account on Power BI Desktop when uploading the pbix file.

 

Instead of using 'Leasing Metrics'[Date] for EOMONTH, You need to use the 'Date'[Date] which is being use as a filter.

 

First, you need to establish a relationship between the two tables through the Date field in the Leasing Metrics table and the Date table.

 

Secondly, modify the measure syntax as follows:

CALCULATE(
     SUM('Leasing Metrics'[Future Occupancy]),
     'Leasing Metrics'[Date] = EOMONTH(MAX('Date'[Date]), -1) + 1
)
/
CALCULATE(
     SUM('Leasing Metrics'[Total Units]),
     'Leasing Metrics'[Date] = EOMONTH(MAX('Date'[Date]), -1) + 1
)

 

You can try using this modified measure to see if it meets your needs.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

I cannot understand what you want but try this

Measure = DIVIDE(CALCULATE(SUM('Leasing Metrics'[Future Occupancy]),DATESBETWEEN('Date'[Date],min('Date'[Date]),min('Date'[Date])))/CALCULATE(SUM('Leasing Metrics'[Total Units]),DATESBETWEEN('Date'[Date],min('Date'[Date]),min('Date'[Date]))))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

I cannot understand what you want but try this

Measure = DIVIDE(CALCULATE(SUM('Leasing Metrics'[Future Occupancy]),DATESBETWEEN('Date'[Date],min('Date'[Date]),min('Date'[Date])))/CALCULATE(SUM('Leasing Metrics'[Total Units]),DATESBETWEEN('Date'[Date],min('Date'[Date]),min('Date'[Date]))))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @ryan012620 ,

 

Your request is too vague. I hope you can provide me with sample data and expected results. Do not take screenshots. Please remember to erase sensitive data. It would be better if you can provide the pbix file. Remember not to log in to your account on Power BI Desktop when uploading the pbix file.

 

Instead of using 'Leasing Metrics'[Date] for EOMONTH, You need to use the 'Date'[Date] which is being use as a filter.

 

First, you need to establish a relationship between the two tables through the Date field in the Leasing Metrics table and the Date table.

 

Secondly, modify the measure syntax as follows:

CALCULATE(
     SUM('Leasing Metrics'[Future Occupancy]),
     'Leasing Metrics'[Date] = EOMONTH(MAX('Date'[Date]), -1) + 1
)
/
CALCULATE(
     SUM('Leasing Metrics'[Total Units]),
     'Leasing Metrics'[Date] = EOMONTH(MAX('Date'[Date]), -1) + 1
)

 

You can try using this modified measure to see if it meets your needs.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

ryan012620
New Member

ryan012620_1-1714987039026.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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