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
mattkarriker
Helper I
Helper I

Time Slicer issues - SSAS MD

I have an issue where the time slicer does not seem to be working for calculated measures that use PARALLELPERIOD.  I have a report filtered to the current year.  I add the time slicer to the report at the month level for ease of use.  However no matter what I change in the time slicer my PY Year calculation always shows the total for prior year.  The time slicer is based on dimension Hierarchy [Date.][calendar Date] my Prior YEar calcs use PARALLELPERIOD with the [Date.][calendar Date] hierarchy.  

 

If I add a table listing months from date dimension, current year values, and prior year values everything works fine.  But not cards or any visual where I do not break the data down by month or day.  Any thoughts on what may be going on?  

 

Another test I performed was to see what members from the hierarchy is passed to the cubes as I change the slicer.   I created measures to return count of existing members in the various Date Hierarchies.  They all return all members of the current year no matter what the time slicer is set to.  

 

This has been a thorn in my side for three days.  Please help me understand what is going on.  Below are images of how the measures appear in PBI.  You will notice the Total PY value does not change no matter what I do with the slicer.  If I do include month in the visual the PY number will break out by month but the total never changes.  I want to use a card to display current year and prior year values but only for the month selected in the slicer.  image.png

image.pngimage.png

 

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@mattkarriker

 

What you created is a calculated measure, which has no aggregation usage. So when you filter on child level, the calculated measure will never filter accordingly. For your requirement, you need to create a dummy measure in your source measure group. Then create a SCOPE statement to achieve it. 

 

1.PNG

 

2.PNG

33.PNG

 

444.PNG

 

See a slimilar thread on MSDN forum:

 

https://social.msdn.microsoft.com/Forums/en-US/5e4128f3-ee4f-4178-8b4a-8432b910611e/total-calculatio...

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@mattkarriker

 

What you created is a calculated measure, which has no aggregation usage. So when you filter on child level, the calculated measure will never filter accordingly. For your requirement, you need to create a dummy measure in your source measure group. Then create a SCOPE statement to achieve it. 

 

1.PNG

 

2.PNG

33.PNG

 

444.PNG

 

See a slimilar thread on MSDN forum:

 

https://social.msdn.microsoft.com/Forums/en-US/5e4128f3-ee4f-4178-8b4a-8432b910611e/total-calculatio...

 

Regards,

Hi Folks,

 

I am facing the same issue except I'm trying to use the relative date slicer in Power BI.  I need to be able to set it up to give me the Last 1 Months (Calendar). 

 

This thread is great and has helped me to understand why a calculated measure for parallelperiod didn't aggregate.  I can get this example to work but in my production system I have an added challenge.  I need to apply a static set in the scope.  This worked for me but the performance is terrible (usually over 7 seconds).  Without the static set the data returns sub second.

 

Here is what I did in the scope statement:

scope([Date].[Calendar].[Date].members);

  [Measures].[Pre Year Reseller Sales Amount] = 

Aggregate([Static Set Name], (parallelperiod([Date].[Calendar].[Calendar Year],1,

[Date].[Calendar].currentmember), [Measures].[Reseller Sales Amount]));

end scope;

 

Any thoughts as to why this is happening?  We use the same named set in a lot of calculated measures and performance is sub second.

 

Thanks!

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.