Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 .
Can anyone solve this using dax . this would be more helpful .
Thanks in Advance,
Thanks
Sandeep
Solved! Go to Solution.
Hi @avulasandeep ,
Update the measure.
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),Table1[MonthNo]=MAX(Table1[MonthNo])+1))-CALCULATE(SUM(Table1[Purchase]))
Regards,
Frank
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
Hi @avulasandeep ,
Update the measure.
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),Table1[MonthNo]=MAX(Table1[MonthNo])+1))-CALCULATE(SUM(Table1[Purchase]))
Regards,
Frank
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
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))
Regards,
Frank
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |