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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.