Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi all,
I have a slicer on my report where the Month can be selected within a year. The slicers is as follow:
I am also using the calculation of the SQLBI page where you can display the last 6 months up until the selected month. See following link: https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
This is all working fine and perfect but I want to change 1 thing regarding this DAX calculation. Can I change this that the last 6 months will be displayed IF it is in the selected year of the selected month. So that means that if a user has selected April 2021, it will only display the months March, Feb and Jan.
@Anonymous can you share your data in text format which can be copied.
Proud to be a Super User!
Hi @negi007 , thanks for the reply.
My date table looks as follow:
Date | Year | Month Num | Month Name | Month Year | Month Year Order | Current Month |
6/1/2021 | 2021 | 1 | Jan | Jan 2021 | 202101 | Previous Month |
20/6/2021 | 2021 | 6 | Jun | Jun 2021 | 202106 | Previous Month |
15/12/2021 | 2021 | 12 | Dec | Dec 2021 | 202112 | Current Month |
Current Month is calculated as follow:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |