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
avulasandeep
Helper III
Helper III

Need Difference of next month to selected month using dax

HI PowerBI Experts ,

 

need the dax formula for the selected with previous month or year seelction  for salesand Purchase for the selected year or month .

 

Here is the Screenshoot for more details. can any one help out from this .

 

 

 

 

WhatsApp Image 2019-03-08 at 10.49.16 AM.jpeg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Can anyone solve this using dax . this would be more helpful .

 

 

Thanks in Advance,

 

Thanks 

Sandeep  

 

2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @avulasandeep ,

 

Update the measure.

 

Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),Table1[MonthNo]=MAX(Table1[MonthNo])+1))-CALCULATE(SUM(Table1[Purchase]))

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Hi @avulasandeep ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @avulasandeep ,

 

Update the measure.

 

Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),Table1[MonthNo]=MAX(Table1[MonthNo])+1))-CALCULATE(SUM(Table1[Purchase]))

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @avulasandeep ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
v-frfei-msft
Community Support
Community Support

Hi @avulasandeep ,

 

1. Create a calculated column as below.

 

MonthNo = SWITCH(Table1[Month],"January",1,"February",2,"March",3,"April",4,"May",5,"June",6,"July",7,"August",8,"September",9,"October",10,"November",11,"December",12)

2. Create a measure to get the result we need.

 

Measure = CALCULATE(SUM(Table1[Sales]))- CALCULATE(SUM(Table1[Purchase]),FILTER(ALL(Table1),Table1[MonthNo]=MAX(Table1[MonthNo])-1))

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi ,

Please read the question what I need , here I need the solution for multiple years selected that output should be sales of selected month - previous month purchases. But the above formula is getting output as selected month -1 only what about the sales of the selected month - previous month selected value how to get that????
Please let me know any questions...?

Thanks
Sandeep

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.