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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Dada786
New Member

How to set a report to the default max date in M query Parameter value in Power Query or Desktop

Hi,

 

I have a task to achieve the report to show always max date or defaut the max date.
I connected in Direct query Mode.

I created M query Paramter to select date in the slicer.

Now, I want to show the report always to the default max date or the slicer should select dynamically or pickup the latest date in the slicer. If, not set the M Query Parameter to pickup the max date in query editor.

Output:
I want to show the data in the report always to max date without passing the value in M Query Parameter from Power Bi desktop Date slicer

5 REPLIES 5
Dada786
New Member

Hi, 

Thanks for the reply. 

But, I don't see the Relative Date below.

Dada786_0-1712154340536.png

 

The column used for Bind to Parameter. Because of this I don't see the RelativeDate.

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41

Hi,

This M Query parameter I am calling in Main query and which I connected in Direct Query Mode the main table.
There is a Distinct table loaded to the Date and from that table I am able Bind to Parameter which I created in M Query Parameter (ExtractDate).
Note: "The M Query Parameter" values is converted in Main query as below.
select * from table name
cast(ExtractDate as date) = '"&Date.ToText(Date.From(ExtractDate),"yyyy-MM-dd")&"'

like this I am passing the values to the main query.

 

Now, the distinct date table column bound to a M Query Parameter, which I am using a slicer in Power Bi Desktop. Since, the value passing as "Text" type to the main query, I am not getting the Relative Date option.

Please help me on this.

Note: I am not sure how to vote

The table where you provide the list of TEXT values for slicer, how does it work? Maybe you could have another column there, that will translate text to date value, and then you will be able to select a latest date?

lbendlin
Super User
Super User

Use the Filter Pane.  It has Relative Date filters.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors