cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors