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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
pcowman1
Helper I
Helper I

Using a Single Date as a Parameter for Aging AP/AR

I'm trying to use a Parameter to change the date that I age AR and AP by. Usually I would just use Today() but instead I want to use the parameter AgeByDate. However, when I update the parameter in Desktop or in the service it doesn't change any of the numbers.

 

In M Query I created a column with the following:

 

#"Add Age" = Table.AddColumn(#"Filtered Rows", "Doc Age", each Duration.Days(@AgeByDate - [Document_Date]))

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @pcowman1 

Create what-if parameter in Power BI,

Then create a measure

age = DATEDIFF(MAX([birthdate]),DATE([year Value],[month Value],[day Value]),YEAR)

Capture12.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @pcowman1,

 

did you solve your problem?


If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


@mwegenerI haven't had a chance to try yet. Maybe this week. 

Anonymous
Not applicable

Create one dummy Date table and create one after date slicer which allow user selection input.

 

Then Create below Column for age calculation.

int(YEARFRAC(Table[Date_Of_Birth],MIN('Date'[CALENDAR_DATE])))
v-juanli-msft
Community Support
Community Support

Hi @pcowman1 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
 
Best Regards
Maggie
v-juanli-msft
Community Support
Community Support

Hi @pcowman1 

Create what-if parameter in Power BI,

Then create a measure

age = DATEDIFF(MAX([birthdate]),DATE([year Value],[month Value],[day Value]),YEAR)

Capture12.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @pcowman1 ,


did you do a data refresh?

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


I don't want to do a data refresh every time the date changes.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @pcowman1 ,

 

Unfortunately, this is part of a change in Power Query.

At runtime, it only works with DAX and a what-if parameter.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors