Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Trying to build a simple bar chart say Sales by months.
Any advice on the best practice to implement this?
You should be able to use a technique similar to:
DaysPast = DATEDIFF([Date],TODAY(),DAY)
DATEDIFF will also take "MONTH" in the last parameter. Then you can just set the filter to something like DaysPast > 30 days or 12 months for example.
I am tackling a similar scenario but for some reason, I am having some problem and I am not able to figure out the solution
In a table, I am having a column with the date. I have only 6 months of Date and data in the table.
When I pull the column to a slicer, it shows the first date and last date correctly where as when I pull the date to a table, it lists all the months. Is this a bug?
I want to calculate the number of months I have selected, but the measure always ends up showing 12 instead of 6.
The measure I am using is
CountOfMonths = DATEDIFF(FIRSTDATE(Table1[SampleDate].[Date]),
LASTDATE(Table1[SampleDate].[Date]),MONTH)
Thanks for that. It does work.
The only problem is that it hard coded to be today() which is current day/month. In reality, users want to be able to do from a selected / specified month (EG from a slicer). In the other words, can we do past N months from current SELECTED month instead of current month?
@Anonymous
According to your description, it seems that you're looking for a date range slicer. There's already one official customized The Timeline Slicer.
You can download the visualization and sample from here.
There is a feature request that will enable users to make an offset to time intelligence - please vote if you think it will satisfy your needs.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 31 | |
| 24 | |
| 22 |
| User | Count |
|---|---|
| 134 | |
| 111 | |
| 57 | |
| 44 | |
| 38 |