Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have SUM(Sales) data for Jan-Dec. I have a Month slicer that shows Jan-Dec as a dropdown. I want this slicer to work such that if a user selects the month Jul from the slicer, the trend chart should not filter Jul data, but it should show the line chart from Jan-Jul. The line should stop where it encounters the selected month.
Hi,@CharanIndukuri .
Has your problem been solved?
If you have found suitable solutions, please share them as it will help more users with similar problems.
Or you can mark the valid suggestions provided by other users as solutions.
Thank you very much for your understanding and support of Power BI.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,johnt75 ,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hello,@CharanIndukuri . I am glad to help you.
You can also filter the target results (based on the value of the measure) by marking the desired data with the value of the state of the measure.
Like this.
When selecting “2024-7”, filter out data from January to July 2024.
Here is my test data:
1. create a slicer table (do not create a relationship with the original data table, to avoid slicer according to the relationship directly filter data)
Create a slicer using the fields of a slicer table (only passes filtered data, no filtering effect per itself)
Create a filtering measure.
M_filter =
VAR YearMonthString = SELECTEDVALUE('SlicerTable'[YearMonth])
VAR _monthValue = MID(YearMonthString, FIND("-", YearMonthString) + 1, LEN(YearMonthString) - FIND("-", YearMonthString))
VAR _yearValue = LEFT(YearMonthString, FIND("-", YearMonthString) - 1)
VAR _selectedDate = DATE(_yearValue,_monthValue,1)
VAR _slicerEndDate= EDATE(_selectedDate,1)-1
VAR _slicerStartDate=EDATE(_selectedDate,-6)
VAR _date=MAX('SalesTable'[Date])
RETURN
IF( _date >= _slicerStartDate && _date<= _slicerEndDate ,
1,
0)
Filtering based on the status value of measure, marking six months of data (containing the selected month) as 1
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @johnt75 , this will give me last six months as per slicer but my requirment one logic as your suggested and the other logic, if i select july month in slicer then chart it should show jan to jun.
The same principle holds. You can create different calculation items to show different time periods by tweaking the logic for which dates from Previous Dates are visible.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |