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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply

Display the selected month in the slice for all years of my dataset.

Hi community,

I'm having the following case:

For example, in a date Slicer, I select the period 10/01/2019 - 10/31/2019 (October). Then, I need to display a bar chart with same
month selected (October) for all years of my dataset.

The Slicer need be a slider format.

4 REPLIES 4
Fowmy
Super User
Super User

@Wilianfilho_ps 

You need to make a copy of your dates table, Say if your date table is Dates and the Copy Dates2. Create the following Measure

All Year Month= 

VAR _Date1SelectedMonth = MONTH(MAX(Dates[Date]))
var _Date2Selected = MAX(Dates2[Date])

Return

IF(
    MONTH( _Date2Selected ) = _Date1SelectedMonth , 
    [Measure to Apply]
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi, the solution It didn't work for the year, the values ​​appear only when I'm in the context of the month. Which turns out to be a problem when I have more than one month selected, as I need a single bar with the sum of the selected period for each year.

@Wilianfilho_ps 

I have added a month column to the DATES table and modified the formula.

All Year Month = 

VAR _Months = VALUES(Dates[Month]) Return

IF( MONTH(MAX(Dates2[Date])) in _Months, 1, 0)

 
I have selected Mar Apr and Jun in 2018 the table visual shows the same months for all three years.

Fowmy_0-1602662781123.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Example:
I have this data set:

YearMonthTotal
2018jan50
2018fev22
2018mar11
2018abr16
2018mai23
2018jun32
2018jul25
2018ago11
2018set554
2018out5
2018nov10
2018dez15
2019jan12
2019fev21
2019mar19
2019abr27
2019mai226
2019jun222
2019jul33
2019ago24
2019set99
2019out10
2019nov10
2019dez20


I need that visualization.

grafico mes outubro.jpg

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors