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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Gflood
New Member

Bar graphs

I am looking to basically combine two bar graphs. I want to show the diference before and after a major change. This involves comparing data by day. So I want to show the difference between the same days of the week from two different weeks side by side in a bar graph. When I add multiple dates that are the same day of the week, the data is just compbined. Is there a way to get them to show side by side?

 

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Gflood ,

I created some data:

vyangliumsft_0-1722477828513.png

 

Here are the steps you can follow:

1. Create calculated table.

 

Table 2 =
DISTINCT('Table'[Date])

 

2. Create measure.

 

Flag =
var _select=
SELECTCOLUMNS('Table 2',"selectdate",'Table 2'[Date])
var _column1=
ADDCOLUMNS( _select,"mindate",MINX(FILTER(ALL('Table'),'Table'[Weeknum]=WEEKNUM(EARLIER([selectdate]),2)-1&&'Table'[Weekday]=WEEKDAY(EARLIER([selectdate]),2)),[Date]),
"maxdate",MINX(FILTER(ALL('Table'),'Table'[Weeknum]=WEEKNUM(EARLIER([selectdate]),2)+1&&'Table'[Weekday]=WEEKDAY(EARLIER([selectdate]),2)),[Date]))
return
IF(
    MAX('Table'[Date]) in _select   ||
    MAX('Table'[Date]) in SELECTCOLUMNS(_column1,"mindate",[mindate]) ||
    MAX('Table'[Date]) in SELECTCOLUMNS(_column1,"maxdate",[maxdate]),1,0)

 

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1722477884789.png

4. Result:

vyangliumsft_2-1722477884795.png

 

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @Gflood ,

I created some data:

vyangliumsft_0-1722477828513.png

 

Here are the steps you can follow:

1. Create calculated table.

 

Table 2 =
DISTINCT('Table'[Date])

 

2. Create measure.

 

Flag =
var _select=
SELECTCOLUMNS('Table 2',"selectdate",'Table 2'[Date])
var _column1=
ADDCOLUMNS( _select,"mindate",MINX(FILTER(ALL('Table'),'Table'[Weeknum]=WEEKNUM(EARLIER([selectdate]),2)-1&&'Table'[Weekday]=WEEKDAY(EARLIER([selectdate]),2)),[Date]),
"maxdate",MINX(FILTER(ALL('Table'),'Table'[Weeknum]=WEEKNUM(EARLIER([selectdate]),2)+1&&'Table'[Weekday]=WEEKDAY(EARLIER([selectdate]),2)),[Date]))
return
IF(
    MAX('Table'[Date]) in _select   ||
    MAX('Table'[Date]) in SELECTCOLUMNS(_column1,"mindate",[mindate]) ||
    MAX('Table'[Date]) in SELECTCOLUMNS(_column1,"maxdate",[maxdate]),1,0)

 

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1722477884789.png

4. Result:

vyangliumsft_2-1722477884795.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.