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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Topographical
Frequent Visitor

Calculating values at specific levels/points in the report?

I have data that I've laid out by date, then by unique number, and at those points of the report, I need to perform a certain calculation based on items associated with that unique number.

 

I'd then need to aggregate values at those specific points of the report.

 

What would be the best way of going about this?

 

I created a sample file to show what I mean, but can't seem to upload the file.

 

So I basically want to calculate at this point, for every one of these points:

Capture.PNG

That is the view, drilled down through the dates and into the uniques

1 ACCEPTED SOLUTION

Hi,

 

Try this calculated column formula

 

=CALCULATE(SUM([Amounts]),FILTER(Data,[Date]=EARLIER([Date])),Data[Items]="x")-CALCULATE(SUM([Amounts]),FILTER(Data,[Date]=EARLIER([Date])),Data[Items]="y")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hi @Topographical,

 

What type of calculation you wan to do based on your explanation this is can be achieve with a measure in DAX however without further explanations I'm unable to help better.

 

Can you provide a sample of your data, explanation of calcutation to be made and expected result.

 

thank you

 

Regards,

Mfelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



 

Hi there,

 

Here is the sample data I prepared that feeds into the screenshot I used above.

 

2.PNG

 

So basically the calculation that I need at the point that I showed above would be based on the "items", so let's say for this simple example that the calculation would need to be the sum of x - the sum of y, for each unique, for each month, basically. 

 

Thank you!

Hi there,

 

I am expecting x -y for each unique for each month (ie not row by row, but just for those points), and then I'd like to aggregate those values. 

Hi,

 

Try this calculated column formula

 

=CALCULATE(SUM([Amounts]),FILTER(Data,[Date]=EARLIER([Date])),Data[Items]="x")-CALCULATE(SUM([Amounts]),FILTER(Data,[Date]=EARLIER([Date])),Data[Items]="y")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you for this! I will give it a try.

Hi,

 

What result are you expecting in column E.  Please show those numbers.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.