Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Team,
I have a bar chart with date on x-axis and profit on y-axis. The requireent is to have the buttons on top like "Last 1 Month", "Last 2 Months" and "Last 6 Months" as shown in attached screenshot.
When I click on the tab 'Last 1 month' then the graph should be plotted for last 30 days. When I click on the tab "Last 2 Months" then the graph should be plotted for last 60 days. Similarly for last 6 months.
Note: As per my analysis, this can be acheived thru bookmarks (show/hide charts as per text button selection).
Also the same can be achieved thru what-if parameter. But users have suggested to make it dynamic with buttons and one chart.
.pbix file here
https://1drv.ms/u/s!ArRkjWtfVLy-bH0zanIVQBIK1u4
screenshot here
Solved! Go to Solution.
@BSM1985 You can do this with a column in your table where you flag items last 2 months, etc. Otherwise, you can do it in a measure like:
Measure =
VAR __Selected = MAX('Slicer'[Value])
VAR __Calc = <some calculation>
RETURN
IF(MAX('Date'[Date]) < TODAY() && MAX('Date'[Date])>=DATE(YEAR(TODAY()),MONTH(TODAY()),1),__Calc,BLANK())
As an example.
@BSM1985 , Very similar stuff was discussed in this ticket see if that can help . https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-3...
But use an independent date table. Other data can group on a single date refer:https://www.youtube.com/watch?v=duMSovyosXE
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |