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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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