Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am looking to create a DAX formula to get the Total Sales of max date of each month for Scenario = "Actual", and Category = "Applicances".
Thanks!
Sample Data:
| Date | Category | Scenario | Customer | Total Sales |
| 4/26/2013 | Bookcases | Plan | Adam Bellavance | 6548.5 |
| 4/26/2013 | Bookcases | Plan | Adam Bellavance | 2153.55 |
| 4/26/2013 | Appliances | Actual | Adam Bellavance | 2472.66 |
| 11/7/2014 | Tables | Plan | Adam Bellavance | 1516.84 |
| 11/7/2014 | Tables | Plan | Adam Bellavance | 2036.86 |
| 11/7/2014 | Tables | Actual | Adam Bellavance | 1565.12 |
| 11/26/2014 | Tables | Plan | Adam Bellavance | 1237.56 |
| 11/26/2014 | Appliances | Plan | Adam Bellavance | 548.56 |
| 11/26/2014 | Appliances | Actual | Adam Bellavance | 367.67 |
Required Output
| 4/26/2013 | Appliances | Actual | Adam Bellavance | 2472.66 |
| 11/26/2014 | Appliances | Actual | Adam Bellavance | 367.67 |
| 2840.33 |
Solved! Go to Solution.
Sum of Max Date for Each Month =
SUMX(
VALUES( DATA[Customer] ),
SUMX(
VALUES( DATA[Yr-Mth] ),
VAR __tr = TREATAS( { ( "Appliances", "Actual" ) }, DATA[Category], DATA[Scenario] )
VAR __max = CALCULATE( MAX( DATA[Date] ), KEEPFILTERS( __tr ), ALL( DATA[Date] ) )
RETURN
CALCULATE(
SUM( DATA[Total Sales] ),
KEEPFILTERS( DATA[Date] = __max ),
__tr
)
)
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Sum of Max Date for Each Month =
SUMX(
VALUES( DATA[Customer] ),
SUMX(
VALUES( DATA[Yr-Mth] ),
VAR __tr = TREATAS( { ( "Appliances", "Actual" ) }, DATA[Category], DATA[Scenario] )
VAR __max = CALCULATE( MAX( DATA[Date] ), KEEPFILTERS( __tr ), ALL( DATA[Date] ) )
RETURN
CALCULATE(
SUM( DATA[Total Sales] ),
KEEPFILTERS( DATA[Date] = __max ),
__tr
)
)
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 13 | |
| 12 | |
| 10 |