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
PaulusB
Frequent Visitor

How to create an input variable with date format?

I have data of a stock portfolio with purchases and sellings of stocks (date, quatity, price). I need an input variable for the single reporting date in normal date format MM-YYYY. So far I was only able to create an input variable in serial number format.

 

In this way a user can easily select a reporting date (MM-YYYY) and the porfolio as per this particular date will be shown.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PaulusB , You can use automatic date Hierarchy, but you will not get that format.

 

You can choose the format in column tools

 

Or create a new column in table or date table

 

Month Year = FORMAT([Date],"mm-yyyy")

 

Sort it on the sort column below 

Month Year sort = FORMAT([Date],"yyyymm")

 

 

 

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@PaulusB , You can use automatic date Hierarchy, but you will not get that format.

 

You can choose the format in column tools

 

Or create a new column in table or date table

 

Month Year = FORMAT([Date],"mm-yyyy")

 

Sort it on the sort column below 

Month Year sort = FORMAT([Date],"yyyymm")

 

 

 

 

 

Thanks a lot for the very quick solution 🙂

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.