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! Learn more
To simplify I need to use the Max formula as Max(1,2,3) where it returns 3. But it is not possible, so is there is a way around it. So I have sales in a column and day name in the other. I need the day with the highest total sales. Here is the way I tried to achieve it:
Best Day =
            Var Sun = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Sunday")
Var Mon = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Monday")
Var Tues = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Tuesday")
Var Wed = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Wednesday")
Var Thurs = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Thursday")
Var Fri = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Friday")
Var Sat = CALCULATE(SUM('Sales (2)'[Sales]), 'Dax Calendar'[Day Name] = "Saturday")
RETURN
MAX(Sun,Mon,Tues,Wed,Thurs,Fri,Sat)
Solved! Go to Solution.
Hi @Saud_Jilani 
You can create 2 measures :
1 for highest sales :
Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @Saud_Jilani 
For the highest second day, you can use these formulas :
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @Saud_Jilani 
You can create 2 measures :
1 for highest sales :
Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thanks @Ritaf1983 , its perfect.
Any idea on how to get the 2nd best day as well? 
Hi @Saud_Jilani 
For the highest second day, you can use these formulas :
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @Saud_Jilani - create below measure to calculate the highest total sales, I hope you have a day name column in your dataset.
Measure:
Best Day Sales =
MAXX(
VALUES('DaySales'[Day Name]), -- Iterate over each unique day name
CALCULATE(SUM('DaySales'[Total Sales])) -- Calculate total sales for each day
)
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
 
 Proud to be a Super User!  |   | 
Thanks, @rajendraongole1, it works well.
How can modify it to result as:
The Highest day is "x" with the sales"$x" and the 2nd highest day is "y" with the sales "$y" . 
By "$x" I refer the amount, and "x" refers to the corresponding day. 
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.