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
ovonel
Post Prodigy
Post Prodigy

issue with snow schema when using SAMEPERIODLASTYEAR?

I have a schema with relationships:

Many Revenue[ClientKey] : 1 Client[ClientKey]

filter: << To Revenue

Many ClientType[ClientNo] : 1 Client[ClientNo]

Many ClientType[Year] : Many Date[Year]

Not sure how I will use the last 2 relationships in the pbix; but I set the filter to <<"Both tables">>

I am having issues with basic measures:

  • Revenue := YTDCALCULATE([Revenue] ,DATESYTD('Date'[Date] ,"31/05" ))

  • Revenue LYTD := CALCULATE( [Revenue YTD],SAMEPERIODLASTYEAR('Date'[Date] ) )

Revenue displays ok. But Revenue LYTD, displays only the total in a table visualization. Could the relationship somehow make this?

1 ACCEPTED SOLUTION
sm_talha
Resolver II
Resolver II

I believe the problem is with this relationship Many ClientType[Year] : Many Date[Year], you need to change the relationship to be based on the lowest granularity level i.e. Dates. Power BI time intelligence functions only works with continuous dates. 

If you have Dates column in ClientType table then add Dates column in the Date table and create a relationship based on that.

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi  @ovonel ,

 

Could you tell me if @sm_talha 's post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌

 

Best Regards,
Eyelyn Qin

sm_talha
Resolver II
Resolver II

I believe the problem is with this relationship Many ClientType[Year] : Many Date[Year], you need to change the relationship to be based on the lowest granularity level i.e. Dates. Power BI time intelligence functions only works with continuous dates. 

If you have Dates column in ClientType table then add Dates column in the Date table and create a relationship based on that.

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.