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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

More months on Bar Graph than on Slicer

Hi,

 

I have a dashboard with a date slicer used to select one month.

I also have a Bar Graph that displays the agregated value for this particular month. The value comes from a measure copied at the end of this post.

 

AntoineC_0-1663592567582.png

 

--> I want to select a single month on the slicer and have my Bar Graph show the results for the selected month + 11 months prior.

 

For instance if the slicer is set to 2022-07, I want the graph to show results from 2021-08 to 2022-07. And if the slicer is changed to 2021-12, I want the graph to show results from 2021-01 to 2021-12. The results would look like the screenshot below, obtained via forcing the date range in a filter in the graph and disconnecting interaction between slicer and graph.

 

AntoineC_1-1663593457176.png

 

I can't get my head around expanding the date range filtered by a slicer and using it in a graph... Someone knows how to do this ?

 

 

Bar Graph X-Axis on the graph is a calculated column from my dates table, with endofmonth dax formula.

Bar Graph Y-Axis comes from this measure, a bit complex because it manages different agregations according to a parameter table (T_FIL_PARAM_INDIC) :

VALUE =
VAR COES = MAX(T_FIL_PARAM_INDIC[CD_EDS])
VAR INDIC = SUBSTITUTE(MAX(T_FIL_PARAM_INDIC[CO_INDIC]),"_EFF","")
RETURN
IF(DISTINCTCOUNT(T_FIL_PARAM_INDIC[LIBELLE_INDIC])>1,BLANK(),
IF(
MAX(T_FIL_PARAM_INDIC[AGREGAT]) = "Somme",
SUM(T_FIL_COMPLET_Q[NUM])+0,
IF(
MAX(T_FIL_PARAM_INDIC[AGREGAT]) = "Ratio",
DIVIDE(SUM(T_FIL_COMPLET_Q[NUM]),SUM(T_FIL_COMPLET_Q[DENOM]))*100+0,
IF(
MAX(T_FIL_PARAM_INDIC[AGREGAT]) = "Moyenne",
DIVIDE(SUM(T_FIL_COMPLET_Q[NUM]),SUM(T_FIL_COMPLET_Q[DENOM]))+0,
IF(
MAX(T_FIL_PARAM_INDIC[AGREGAT]) = "Stock",
CALCULATE(SUM(T_FIL_COMPLET_Q[NUM]), LASTDATE(T_FIL_COMPLET_Q[DTJOUR]))+0,
IF(
MAX(T_FIL_PARAM_INDIC[AGREGAT]) = "Efficience",
DIVIDE(
CALCULATE(SUM(T_FIL_COMPLET_Q[NUM]), ALL(T_FIL_PARAM_INDIC[LIBELLE_INDIC],T_FIL_PARAM_INDIC[FREQUENCE],T_FIL_PARAM_INDIC[RANG]),T_FIL_PARAM_INDIC[CO_INDIC] = INDIC),
CALCULATE(SUM(T_FIL_COMPLET_Q[NUM]), ALL(T_FIL_PARAM_INDIC[LIBELLE_INDIC],T_FIL_PARAM_INDIC[FREQUENCE],T_FIL_PARAM_INDIC[RANG]),T_FIL_PARAM_INDIC[CO_INDIC] = "TR_" & COES & "_RH_01")
)+0
))))))

 

1 ACCEPTED SOLUTION
PabloDeheza
Solution Sage
Solution Sage

Hi there!

You can refer to this video/post from SQLBI. 

https://www.youtube.com/watch?v=d8Rm7dwM6gc

Let me know if that helps!

View solution in original post

5 REPLIES 5
PabloDeheza
Solution Sage
Solution Sage

Hi there!

You can refer to this video/post from SQLBI. 

https://www.youtube.com/watch?v=d8Rm7dwM6gc

Let me know if that helps!

Anonymous
Not applicable

Hi Pablo,

 

Thanks for the video, it's very close to what I'm looking for!

Now my chart show the 12 months I want, but it includes the names of all months available in my dates tables...

 

Any idea why ?

 

AntoineC_1-1663595945989.png

 

Thanks,

Antoine

Not sure exactly why that is happening, is it possible that one of your measures has a "+0" somewhere? If not, check the filter pane, it might be possible to remove those values from there.

Yeah i just double checked the measure above, the +0 on it might be the reason.

Anonymous
Not applicable

Removed the 0 and it works like a charm, thanks again !

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.