cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Pass Parameter from selection in Bar Chart Values

I have a requirement where my Bar Chart shows runtime of a Job for Last 7 Days :

Say Job 1 runtime in Minutes (Y Axis) ,  Sysdate .....Sysdate-7 on X Axis

 

Now User want to select any two of above bars(Dates)  and based on his selected date of the two bars : I should show more detail of those selected two dates as comparision in some other chart/report (may be in bar and line chart where bar is for selected Date 1 and Line for selected Date2)

 

Any idea or tricks how to achieve it 

 

1 ACCEPTED SOLUTION
Super User IV
Super User IV

In case you can have two slicers 

https://medium.com/chandakamit/power-bi-comparing-data-across-date-ranges-36be49b68613

In case you have dates joined with fact, used in the slicers

In the same formula use userelation and crossrelation. Join two slicers with the same dates and make one of them inactive.  And turn off and on by using userelation and crossrelation.

 

In case you have only one time slicer and you have a relative date. Then make sure the date/time table is marked as the date table in model view.

 

Then try something like this

 

 

 

On the Fly Change % = 
Var _last_year= (max('Date'[Date Filer]))-365
Var   _This_year=year(max('Date'[Date Filer]))

Var _last_year_val= CALCULATE(sum(Sales[Sales Amount]),(Sales[Sales Date])<=_last_year)
Var   _This_year_val =CALCULATE(sum(Sales[Sales Amount]))
return
(_This_year_val-_last_year_val)/_last_year_val*100

MTD Sales Till Date = 
VAR _Cuur_start = day(CALCULATE(max('Date'[Date Filer]),ALLSELECTED('Date'[Date Filer])))
return  
calculate(sum(Sales[Sales Amount]),FILTER(Sales,day(Sales[Sales Date]) <= _Cuur_start ))


 

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

In case you can have two slicers 

https://medium.com/chandakamit/power-bi-comparing-data-across-date-ranges-36be49b68613

In case you have dates joined with fact, used in the slicers

In the same formula use userelation and crossrelation. Join two slicers with the same dates and make one of them inactive.  And turn off and on by using userelation and crossrelation.

 

In case you have only one time slicer and you have a relative date. Then make sure the date/time table is marked as the date table in model view.

 

Then try something like this

 

 

 

On the Fly Change % = 
Var _last_year= (max('Date'[Date Filer]))-365
Var   _This_year=year(max('Date'[Date Filer]))

Var _last_year_val= CALCULATE(sum(Sales[Sales Amount]),(Sales[Sales Date])<=_last_year)
Var   _This_year_val =CALCULATE(sum(Sales[Sales Amount]))
return
(_This_year_val-_last_year_val)/_last_year_val*100

MTD Sales Till Date = 
VAR _Cuur_start = day(CALCULATE(max('Date'[Date Filer]),ALLSELECTED('Date'[Date Filer])))
return  
calculate(sum(Sales[Sales Amount]),FILTER(Sales,day(Sales[Sales Date]) <= _Cuur_start ))


 

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors