Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello everyone,
Can someone please help me how to calculate the maximum of Sales. See the data below:
Data:
Result:
Best regards
Tito
Solved! Go to Solution.
Hi @Tito,
Please try this formula:
MAX Measure =
VAR _Table =
ADDCOLUMNS(
SUMMARIZE(
T_MaxQ,
T_MaxQ[Name],
T_MaxQ[ID]
),
"@MaxSales",
VAR _MAX = CALCULATE(MAX(T_MaxQ[Date]))
VAR _Result =
CALCULATE(
SUM(T_MaxQ[Sales]),
T_MaxQ[Date] = _MAX
)
RETURN
_Result
)
VAR _Result = SUMX(_Table, [@MaxSales])
RETURN
_Result
Proud to be a Super User!
Hi @Tito
please refer the below measures.
Sample Table:
Measure 1:
Measure 2:
Result:
I hope this measure will help you.
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Best Regards,
Ajith Kumar
HI @Tito ,
To get sales by Maximum date you can use this measure,
SalesByMaxDate =
CALCULATE(
SUM('Order Data'[Sales]),
FILTER('Order Data',
'Order Data'[Date]
=MAX('Order Data'[Date])
)
)
Hi @Tito
You can try this dax
Total = calculate (Sum(Table[sales]), max(Date[date])
I hope I answered your question!
Hi @DataNinja777 ,
Thank you for your reply.
If I select name "A", 30 should be returned.
I want the sum sales by maximum of date and not the maximum of sales.
Hi @Tito
Sumxing over ID of the max sales measure will get your required output. I am not sure why combining in one formula will produce the different result from separating out in two measures like below, but separating out in two measure will get your required output.
Sumxing over ID = sumx(values('Table'[ID]),[Max sales])
Best regards,
Hi @Tito,
Here is my solution:
I'm using this measure:
MAX Measure =
VAR _Table =
ADDCOLUMNS(
SUMMARIZE(
T_MaxQ,
T_MaxQ[Name],
T_MaxQ[ID]
),
"@Max", CALCULATE(MAX(T_MaxQ[Sales]))
)
VAR _Result = SUMX(_Table, [@Max])
RETURN
_Result
And the final result is this:
Proud to be a Super User!
Hi @_AAndrade @DataNinja777
Thank you for your reply.
I want the sum sales by maximum of date and not the maximum of sales. See example below:
Data:
Result:
Hi @Tito,
Please try this formula:
MAX Measure =
VAR _Table =
ADDCOLUMNS(
SUMMARIZE(
T_MaxQ,
T_MaxQ[Name],
T_MaxQ[ID]
),
"@MaxSales",
VAR _MAX = CALCULATE(MAX(T_MaxQ[Date]))
VAR _Result =
CALCULATE(
SUM(T_MaxQ[Sales]),
T_MaxQ[Date] = _MAX
)
RETURN
_Result
)
VAR _Result = SUMX(_Table, [@MaxSales])
RETURN
_Result
Proud to be a Super User!