Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AishwariyaV
Helper IV
Helper IV

How to pass month name (String Type)in filters??

CurMonthSales=calculate(sum(order_details[sales],filter(all(order_details[monthname],order_details[Monthname]=max(order_details[MonthName])))

the above syntax is showing error.

in place of MonthName,if I give monthNum its showing correct result,but im using monthName as slicer 

1 ACCEPTED SOLUTION
asc
Frequent Visitor

Try this :
calculate(sum(order_details[sales]),filter(ALL(order_details[monthname]),order_details[monthname]=max(order_details[monthname])))
this will not throw any error but I am afraid that you wont get desired result.
because if you put MAX function for month name, it'll give you max by alphabatically ordering of month which'll be September.
here proper usage is, use MAX with month number.
 
Hope this will help you.
 

View solution in original post

1 REPLY 1
asc
Frequent Visitor

Try this :
calculate(sum(order_details[sales]),filter(ALL(order_details[monthname]),order_details[monthname]=max(order_details[monthname])))
this will not throw any error but I am afraid that you wont get desired result.
because if you put MAX function for month name, it'll give you max by alphabatically ordering of month which'll be September.
here proper usage is, use MAX with month number.
 
Hope this will help you.
 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.