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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Analitika
Post Prodigy
Post Prodigy

DATESINPERIOD only if existing dates

I have measures
 
Incomes, trailing, 12 m =
CALCULATE(
[Incomes],
DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-1,YEAR)
)
Profit, trailing, 12 m =
CALCULATE(
[Profit],
DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-1,YEAR)
)


 Mesure_Total =
DIVIDE([Profit, trailing, 12 m],[Incomes, trailing, 12 m])
 
 
But it count wrong, as i dont have qrt4 for example, but Mesure_Total count last 3 quarters and divide by 3 quarter
also with start dates
 
So how to say measure count only existing dates and only if 4 quarters exist in trailing
No count first 3 quarters from start calendar period and not count last period if not exist
So if start calendar date is 2015Q4 and end date is 2020Q3, but date slicer has 2020Q4
Mesure_Total  must caount only from 2015Q4 until 2020Q3, and not include counting of 2015q1, 2015q2,2015q3 and 2020q4
 
1 REPLY 1
v-robertq-msft
Community Support
Community Support

Hi, @Analitika 

According to your description, I can not get what do you really want in detail. Would you like to post some sample data in table form or pbix file(without sensitive data) and your expected result (like the chart you want to get and the correct measure value based on your sample data)?

Thanks very much!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.