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

Help with Increase and Decrease by day

Hello, 

I'm trying to calculate my increase and also my decrease by day. 

 

Capture.PNG

 

For example, here I have a Matrix reflecting my value by day and product.  What I need is for it to calculate only consider mypositive difference from the previous day for me to have the total increase from yesterday. 

 

 

I tried using: 

 

 
 
But it will be reurning the total amount.
Measure =
VAR Yesterday=CALCULATE(SUM(Table1[Column1]), PREVIOUSDAY(Table1[Date]))
VAR Today= CALCULATE(SUM(Table1[Column1]))

RETURN
Today-Yesterday


Here I attached an example of what I need: 
 
Capture2.PNG
 
So that for March 3rd As I only have positive values for   my products 88884 and 88885 my total shloud be 59 and not -263 that is the equivalent to te substraction of the total of today minus yesterday's total.
 
Does anybody knows if this is possible?
 
Thankss!
2 ACCEPTED SOLUTIONS

Hi,

You may download my revised PBI file from here.

Hope this helps.


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

View solution in original post

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


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

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

@Ashish_Mathur 

 

Thanks for your help. Although there is still one thing that I am missing

 

As you can see in the image below, for March 2nd I got a difference of -34 (BOX IN RED) but I don't need that to be consider as part of my total sum, I just want to sum all those values for that measure that are greater than 0 if it is not greater than 0 i don't want to sum  it.  So I would be expecting a 280 instead of a 314

 

Is this possible?

Anonymous
Not applicable

Hi,

You may download my revised PBI file from here.

Hope this helps.


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

Hi, 

 

May I ask you if there is a possible way to do the same but for the decrease?

If the code appears today but no longer tomorrow I want it to reflect it as a negative.

 

Here I attached an example

Capture3.PNG

For example the code 888890 had value 72 for March 2nd, but it didn't  have any values on March 3rd So i want the measure to return a -72 On March 3rd.  An d the same case for March 4th and 5th returning a -125. So that the measure now instead of giving me the total sum for thos positive values I want it to give me only the sum for the negative ones. 

 

Hope this is possible!

 

Thanks in advance. 

 

@Ashish_Mathur 

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

First, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Second, This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.