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

Where is the aggregation performed?

I have replaced a measure:

CALCULATE ([GM % YTD], SAMEPERIODLASTYEAR('Date'[Date]))

 

With measure:

VAR VAR1 = ADDCOLUMNS( VALUES(Revenue[Key_Client]), 
                       "Col1", CALCULATE([GM % YTD], SAMEPERIODLASTYEAR('Date'[Date]),
                        REMOVEFILTERS(Revenue[Type],Revenue[SectorType]))
)

RETURN AVERAGEX(VAR1, [Col1])

 

 

Both measures point to GM % YTD, which is:

CALCULATE([GM %]
          ,DATESYTD('Date'[Date],"31/05"))

 

I see some problems when I display them side by side:

ovonel_0-1632751748399.png

 

 

I am unable to find how/where is the aggregation used...  73,2% doesn't seem to be average

 

Also… how can I force the measure on the right to do the same aggregation?

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ovonel , if you need last year YTD try like

 

 

CALCULATE([GM %]
          ,DATESYTD(dateadd('Date'[Date],-1,Year),"31/05"))

 

Make sure date table is marked as date table

 

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ovonel , if you need last year YTD try like

 

 

CALCULATE([GM %]
          ,DATESYTD(dateadd('Date'[Date],-1,Year),"31/05"))

 

Make sure date table is marked as date table

 

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.