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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
OCK
Frequent Visitor

link the time slicer to a measure (calculation)

Hi All,

 

I'd like to have the time slicer dynamically recalculate a measure from the selected start date. The measure creates an indexed time series of percentage returns rebased to 100 at the starting point. This is the measure that I use:

 

FundReturnTmp =
CALCULATE ( 
      IF ( COUNTROWS ( Global_AssetType ) = 1 ; 100 ; PRODUCT ( Global_AssetType[FundReturn] ) * 100 ) ;
      FILTER ( ALL ( Global_AssetType );  Global_AssetType[Date] <= MAX ( Global_AssetType[Date] ) ) ;
      VALUES ( Global_AssetType[OrderKey] )
)

 

Below two screenshots of the chart. The first is with the time slicer set at the starting point of the data and the second is with the time slicer set somewhere in the middle of the series. Aim is to have the second chart dynamically rebased to 100 at the new starting point. Thank you very much for any help.

 

Screenshot 1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot 2.jpg

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @OCK,

 

You can try to use below measure if it works on your side:


FundReturnTmp =
CALCULATE ( 
      IF ( MAX([Date].[Year])=MINX(ALLSELECTED(Global_AssetType);[Date].[Year]);100 ; PRODUCT ( Global_AssetType[FundReturn] ) * 100 ) ;
      FILTER ( ALL ( Global_AssetType );  Global_AssetType[Date] <= MAX ( Global_AssetType[Date] ) ) ;
      VALUES ( Global_AssetType[OrderKey] )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin

 

Thank you very much for your reply. The measure does correctly filter on the time axes (as it did before), however, it does not rebalance the new starting point of the line graphs to 100. It still only takes all values of the data since original start but just displays it in a time window (as before).

 

Maybe it is a nested if function with your suggestion and with countrows. On point: your suggested formula is rather slow in performance (about 10 sec to rebuild the chart)

 

Thank you again

Otto

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors