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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RLBGA
Frequent Visitor

YTD of YTD measure

Hi eveyrone,

 

I have a business case for which I need to calculate the YTD amount of the difference between YTD and YTD of prior period (YTD and  YTD prior period are multiplied by different exchange rate).

 

However, when I calculate the YTD of my difference, nothing is agregated.

 

Does someone have a clue about how to calculate the YTD of YTD measures ?

 

Thanks for your help !

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @RLBGA ,

According to your description, I create a sample.

vkalyjmsft_0-1656666128642.png

Here's my solution, create three measures.

YTD =
CALCULATE ( SUM ( 'Table'[Amount] ), DATESYTD ( 'Table'[Date] ) )
    * MAX ( 'Table'[Exchange Rate] )
Diff =
VAR _Pre =
    CALCULATE ( [YTD], PREVIOUSMONTH ( 'Table'[Date] ) )
RETURN
    IF ( _Pre = BLANK (), BLANK (), [YTD] - _Pre )
Diff YTD =
SUMX ( DATESYTD ( 'Table'[Date] ), 'Table'[Diff] )

 Get the correct result.

vkalyjmsft_1-1656666257510.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @RLBGA ,

According to your description, I create a sample.

vkalyjmsft_0-1656666128642.png

Here's my solution, create three measures.

YTD =
CALCULATE ( SUM ( 'Table'[Amount] ), DATESYTD ( 'Table'[Date] ) )
    * MAX ( 'Table'[Exchange Rate] )
Diff =
VAR _Pre =
    CALCULATE ( [YTD], PREVIOUSMONTH ( 'Table'[Date] ) )
RETURN
    IF ( _Pre = BLANK (), BLANK (), [YTD] - _Pre )
Diff YTD =
SUMX ( DATESYTD ( 'Table'[Date] ), 'Table'[Diff] )

 Get the correct result.

vkalyjmsft_1-1656666257510.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

RLBGA
Frequent Visitor

@amitchandak  thanks for your answer.

Please find below more precisions about my need.

 

1. For each month, I calculate the YTD amount and I multiply it by the exchange rate of the current month.

2. I calculate the difference between current YTD amount (multiplied by current month exchange rate) and the YTD of the prior month (multiplied by prior month exchange rate)

3. Once the difference is calculated (so I have one amount calculated by month), I want to calculate the YTD of that difference by month.

 

The steps 1 and 2 are well calculated : I have my difference of two YTD value calculated by month. However, there is blocking point on the level 3 : I'm not able to sum on a YTD basis that difference calculated by month.

 

 

amitchandak
Super User
Super User

@RLBGA , Not very clear,

 

If you simply need last year then you can have like

 

Year behind Sales = CALCULATE([YTD],SAMEPERIODLASTYEAR('Date'[Date]))

Up - Still not solved

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors