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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Composed_MS
Helper I
Helper I

Issue in YTD trend

Hello, I am facing issue in showing the YTD trend for the below source table.

 

Source table ->

Composed_MS_0-1680170802400.png

YTD logic for March month = Sum of Jan users+Sum of Feb users+ Sum of March users

                                                                                          3
For March Amazon =(500+200+300)/3=333.33

The measure I am using is ->

Measure =
AVERAGEX(
SUMMARIZE(
SUMMARIZE(

    CALCULATETABLE(
        Traffic,DATESYTD('Calendar'[Date])
        )
    ,Traffic[Month],"Users",SUM(Traffic[User])),
    [Users]),
    [Users])

It is giving me correct value in card but in the trend it is giving monthly value.
 
Composed_MS_1-1680170964401.png

 

My model -> To show previous month's trend as well, I have created the Calendar2 table and my X axis is Month Year from Calendar2 table.

Composed_MS_2-1680171006184.png

 

Measure for Trend=

Trend =
var previous_dates=DATESINPERIOD('Calendar2'[Date],MAX(Calendar[Date]),-3,MONTH)
return
 CALCULATE([Measure],
    REMOVEFILTERS('Calendar'),
    KEEPFILTERS(previous_dates),
    USERELATIONSHIP('Calendar'[Date],Calendar2[Date]))

Please help me in showing trend for YTD calculation.

 

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.