Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm trying to connect a power BI report to a SAP HANA database which requires in put of a Date parameter. I've copied the DAX code that was generated below, relating to the "Report_Date" parameter. Instead of typing in a fixed date, how can I change the parameter so that it is dynamic, say, based on yesterdays date.
#"Added Items" = Cube.Transform(CV_STOCKS_SAPDIST_D1,
{Cube.AddAndExpandDimensionColumn, "[CV_STOCKS_SAPDIST_D20]", {"[CV_YCBPARTNR_DIM_SAPDIST].[YCBPARTNR]"}, {"Business Partner"}},
{Cube.ApplyParameter, "Report_Date", {"20180731"}}
}),
Thanks
Tram
Solved! Go to Solution.
Hi Trammie,
Try M code like below and check if it can work:
Date.AddDays(Date.From(DateTime.FixedLocalNow()),-1)
Regards,
Jimmy Tao
Hi Trammie,
Try M code like below and check if it can work:
Date.AddDays(Date.From(DateTime.FixedLocalNow()),-1)
Regards,
Jimmy Tao
Great suggestion.
I have used it as follows to get the current year and previous month, works like a charm.
The only drawback is : now the 'Added Items' screen can not be invoked, all further changes need to be done via the advanced query editor
Thanks!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |