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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Anonymous
Not applicable

Use formulas in Power Query Parameters

Hi all, 

 

How would I create parameters which stores "YYYYMM"-value based on a date input (from another parameter). 

 

I would like to use incremental refresh on a dataset. However, this dataset does not contain a date column, it only has a "YYYYMM" Column. I think I found a workaround. 

 

I can use the RangeStart and RangeEnd parameters for the incremental refresh, which is determined by the settings in Power BI service. I would use two extra parameters which convert RangeStart and RangeEnd into a "YYYYMM"-format which in turn I can use for filtering the datasets; MonthYearRangeStart and MonthYearRangeEnd.

 

How would I create these 'dynamic' parameters?

 

Turning the original YYYYMM column into a date format is not an option, because then I would lose the Query folding. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think I've found a way to achieve this:

 

Create a reference for the Parameter. Edit this new reference, for example, for the RangeStart Parameter rename the reference name to YYYYMM-RangeStart and the contents to:

 

= Number.FromText(Number.ToText(Date.Year(RangeStart)) & Number.ToText(Date.Month(RangeStart)))

 

 

Create a filter for the YYYYMM-column:

 

 each [#"Calendar year/month"] >= #"YYYYMM-RangeStart" and [#"Calendar year/month"] <= #"YYYYMM-RangeEnd"

 

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I think I've found a way to achieve this:

 

Create a reference for the Parameter. Edit this new reference, for example, for the RangeStart Parameter rename the reference name to YYYYMM-RangeStart and the contents to:

 

= Number.FromText(Number.ToText(Date.Year(RangeStart)) & Number.ToText(Date.Month(RangeStart)))

 

 

Create a filter for the YYYYMM-column:

 

 each [#"Calendar year/month"] >= #"YYYYMM-RangeStart" and [#"Calendar year/month"] <= #"YYYYMM-RangeEnd"

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors