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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors