This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi guys,
I usually use dateadd function to compare results in some period, to this same period last month, or other months depending on the value that I use in numbers intervals.
Now I'm wondering to know if it is possible to use a What If parameter to choose a value like 10, and this show in a graph all the values from last 10 months.
I am using a Date slicer to choose the period.
In the picture above you can see my problem, using the date slicer I am able to know how is my revenue now and how it was four months ago in the same period, but I would like to see in this graph the other months, in this case, October, November and December.
The dax function I'm using is
Rev.= Calculate([Revenue];DATEADD(Calendar[Date];-[N Value];MONTH))
@OPpB what is your expectation? You want to see # of months in bar graph based on selection in the slicer ?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Yes, if I choose N=4 I want to see the last four months results no only one, if I use this formula CALCULATE ([Revenue];DATESINPERIOD('Calendar'[Date];MAX('Calendar'[Date]);-[N Value];MONTH)) I will have this.
That is what I want, but using this formula the Revenue that I get in the graph is the revenue from the entire month instead the revenue between the two dates that I've selected.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 25 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 24 | |
| 19 |