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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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

@Anonymous 

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

Anonymous
Not applicable

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.

@Anonymous 

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

Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.