12 month and 1 month visuals on same page

Tcurtis

Board Regular
Joined
Aug 15, 2009
Messages
149
I am new to PowerBi and need to know how to show two visuals with different date ranges on the same page. I have a slicer on my title page that allows someone to select the start date and end date of the report. On a few of my pages I have visuals for both 12 month (or what ever range they select) that is synced with the main page slicer and I have a pie chart that I want to only show the last month in the date range of the column chart. How do I filter my pie chart to only show the most recent month that was selected in the date slicer on my main page?

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

Interesting scenario - could you please share some exemplary data? Also, do I understand correctly that if the user selects 12 months (1 Jan 2018 - 1 Jan 2019), do you want to then display some aggregate (sum? max? avg?) for the last month (1 Dec 2018-1 Jan 2019) on your pie chart?
Is your Pie chart data and Date slicer from the same table, or are they two separate tables? If separate, do they have a relationship in a data model?
 
Upvote 0
I created a date table in PowerBi and linked it to my data. The Date table is what I use for my slicer and filters for my graphs. I do not know how to load data on the website.
I have my year graph by month and by site. My pie chart is for the last month of the year that is displayed on the 1 year column chart by site. I am counting unique job numbers for each month and each site.
 
Upvote 0
Thanks for explaining.

Here's how my two tables are linked in a data model:
1590615295727.png


I have added a table that always shows data for the selected time range, for 3 sites (A, B, C). On the right-hand side, you will notice a pie chart that always shows the values from the last row of the table.

1590615462527.png


1590615475111.png


Here's the DAX measure that I needed to use on my Pie chart, along with some additional comments:

Rich (BB code):
Last Selected = 
    //Slicer - return the last Selected Date
    var vLastDate = 
        MAXX(ALLSELECTED('Date'), 'Date'[Date])
    //Identify the Maximum Date in Table5 that is less or equal selected Date
    var vMaxDate =
        MAXX(FILTER(ALL(Table5[Date]), Table5[Date] <= vLastDate), Table5[Date])
    //Return the Value for the Maximum Date
    var result =
        CALCULATE(MAX(Table5[Value]), Table5[Date] = vMaxDate)
return
    result

I'm hoping this small example will get you started. Let me know if you need any help.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top