cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Georg
Frequent Visitor

Dynamic x axis - show only January - selected month

 

PBI dynamic x axis.PNG

Hi Experts,

is there a way to show only January - selected month figures? E.g. I would like to see January - June figures only if June is the selected month (selecting all month January through June is not an option).

 

Kind regards,

Georg

1 ACCEPTED SOLUTION
Dog
Responsive Resident
Responsive Resident

Hi, 

 

you could look at creating new measure that specifically looks at the selected filter and takes that as the max date but overrides the filter on the calculate

This is assuming that you have a Dates table for filtering. (if no dates table let me know what you have got) 

 

ActualToSelectedMonth:=

var MaxDate = MaxDates([DateKey])

return

CALCULATE (
[Actual], ALL('Dates')
DATESYTD ( Dates[Datekey], "01/31" ),
Dates[DateKey] < MaxDate
)

-------

(the DATESYTD will need your month end day and month in there to know when to start from....) have edited to January for now. 

 

in theory this should replace the current context filter on Month (again assuming it's in the dates table) for [actual] but still using it as a Max filter. 

 

I've not got the same data as you so I'm hoping the above makes sense and assists.

 

View solution in original post

4 REPLIES 4
Dog
Responsive Resident
Responsive Resident

Hi, 

 

you could look at creating new measure that specifically looks at the selected filter and takes that as the max date but overrides the filter on the calculate

This is assuming that you have a Dates table for filtering. (if no dates table let me know what you have got) 

 

ActualToSelectedMonth:=

var MaxDate = MaxDates([DateKey])

return

CALCULATE (
[Actual], ALL('Dates')
DATESYTD ( Dates[Datekey], "01/31" ),
Dates[DateKey] < MaxDate
)

-------

(the DATESYTD will need your month end day and month in there to know when to start from....) have edited to January for now. 

 

in theory this should replace the current context filter on Month (again assuming it's in the dates table) for [actual] but still using it as a Max filter. 

 

I've not got the same data as you so I'm hoping the above makes sense and assists.

 

v-huizhn-msft
Microsoft
Microsoft

Hi @Georg,

You can create a slicer including Month field, when you select one month, it will shows 

 

I have the sample data table.

1.PNG

Create a chart, please see the following screenshot.

2.PNG

Finally, you can create a slicer including Month field, when you select Jan, it will show only Jan and corresponding Sales.

Capture11.PNG

If you have other issues, don't hesitate to let me know.

Best Regards,
Angelia





Hi Angelia,

thanks for your answer. I do have already a slicer, the month above the chart. And if I click on Jun, the June value is shown as expected. But this is not what I cant to achieve. In case of selecting Jun, figures from Jan - Jun shall be shown in the chart.

 

kind regards,

Georg

Hi @Georg,

Got it. As I tested, we are unable to achieve by slicer, When you select Jun, we can ontain the sum of Jan-Jun. But we can't display Jan-Jun in the chart.

Best Regards,
Angelia

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors