cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luc Frequent Visitor
Frequent Visitor

Is there a way to use parameters as start and end of axis range?

By start and end of axis range, I mean these fields in the following image:
power-bi-y-axis.png

 

If you're curious why, I have a report model that asks for a startdate and enddate parameters when opened. I these dates to be the range for the visuals on this report.

3 REPLIES 3
Anonymous
Not applicable

Re: Is there a way to use parameters as start and end of axis range?

Hey @luc

 

Short answer: I would just add a date slicer to your report and set the start and end date. You can sync this slicer across all pages of your report as well.

 

Long answer: Create your parameters and enable load in the Query Editor. Then you can create a calculated column that will look something like:

 

InRange = 
IF(
    AND(FIRSTNONBLANK(StartDate[StartDate],1) <= Table1[Date], FIRSTNONBLANK(EndDate[EndDate],1) >= Table1[Date])
    "Yes",
    "No"
)

Then you can add a Report Level filter for InRange = "Yes".

 

Hope this helps,

Parker

 

luc Frequent Visitor
Frequent Visitor

Re: Is there a way to use parameters as start and end of axis range?

That doesn't work, I already filter the data based on these parameters when querying the data source. The problem is that if I want for example the x axis from a a visual to go from 03/01 to 03/31, if the y axis of that visual has value 0 at 03/01 the visual will automatically resize the x range to go from 03/02 to 03/31. Instead of resizing I want the visual to show a 0 even if there is no data for the first day of March.

Anonymous
Not applicable

Re: Is there a way to use parameters as start and end of axis range?

I would receommend a Date table with a list of continuous dates in your date range. You can then set your X axis to use this date range and still use the calculated column I provided above. As for showing a 0 for that first date, I'm not sure about that. It might just show up as a blank.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 154 members 1,926 guests
Please welcome our newest community members: