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
Anonymous
Not applicable

Acumulated value using measures for YTD

Hi Everyone,

 

I'm having problems with the acumulated value coming from measures. 

 

tsynenkyy_0-1637253820143.png

As you can see in the picture, the last comumn (YTD) should be :
13,06 (13,06 from first month)

25,57 (13,06 +12,64 from second month)

. . .

 

The [AVG net price] is a measure that contains a division between two measures.

The [AVG net net price] is a measure that contains a division between two measures.+

The [Delta net vs net net] is the [AVG net price] - [AVG net net price].

These three columns are OK, the values are like I want them but the problem is that those values are not "stored" they are not acumulated so I cant take the values from the [Delta net vs net net]  and make a YTD because what Power Bi is doing is going down until the first measure, [AVG net price]  and making an average of the first and second value, then is dividing those averages and bringing me the average instead of the sum, this is more or less whats happening here.

 

So what I need is to storage in some way the data of those 3 columns to use that data and calculate the YTD, Paralel or whatever.

 

I already tried the same logic but using the fields directly from the table and everything works, because the data is stored but when I try the same logic with measures the YTD never works because is not acumulating the data.

 

Someone can help me with this?

Thanks

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

 

YTD Sales = CALCULATE(SUMX(values('Date'[Month Year]),[Avg Net Price]),DATESYTD('Date'[Date],"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try like

 

YTD Sales = CALCULATE(SUMX(values('Date'[Month Year]),[Avg Net Price]),DATESYTD('Date'[Date],"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hiiii many thanks for your help, I cant believe it worked  omg.

 

Could you explain that measure? why it works? why mine didnt.

 

Anyways thank you a lot 🙂

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.