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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Need help to write m code

i need to write the m code

my requirement is, i need to create parameters for start year and end year, start month and end month,start week and end week, start date and end date.

if user has selected start week and end week, and not selected year, month and date filter. it automatically take current week of the year. if user has selcte june month not slected other parameters it should take current month of year(june, 2022). Please help how to to write the code. 

i have attached scrrenshots which i have created for week. I have start week and end week parameter. and passed parameter to direct query(query). After publishing the report  in service, I can change paramters dynamically. like i need for year and month and date should include all four (year, month, week, date) be there  If i select only start month and end month parameter only and  user havn't selected anything. it should automatically take current year month) . iam not able attach sample file.so i attcahed screenshot.

Kindly help to write accordingly.

 

swathi1997_0-1660739854412.png

swathi1997_2-1660739921994.png

swathi1997_3-1660740004042.png

 

swathi1997_1-1660739889521.png

 

 

@amitchandak 

1 REPLY 1
lbendlin
Super User
Super User

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.