The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I want to show the data for whole year for all the bars in a bar chart from Jan-Dec for the selected month-Year in slicer.
For e.g., if I select Feb-2025 in slicer, bar chart should show bars data from Jan-2025 to Dec-2025.
Any idea or suggestion is highly appreciated.
Thanks,
Amit
Solved! Go to Solution.
You can adapt the techniques described in https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
Hi @amitpatra
First, make a copy of the calendar table (without joining relationships with other tables), and then use the fields in the copied calendar table to replace the original x-axis.
Then, can try below measure in bar chart:
Measure =
CALCULATE(
SUM(Table[Value]),
PARALLELPERIOD(Calendar[Date],0,YEAR),
TREATAS(VALUES(Calendar_Copy[Date]),Calendar[Date])
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Hi @amitpatra ,
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @amitpatra,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @amitpatra,
Thank you for reaching out to Microsoft Fabric Community Forum.
Create a new table with a Month-Year (MM-YYYY) column, ensuring it has no relationship with the fact table.
Then, Create a measure using the following DAX code.
=CLACULATE(SUM(Sales[Sale]),FILTER(Sales,Sales[YEAR]=SELECTEDVALUE('Calendar'[Year])))
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
Hi @amitpatra ,
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @amitpatra
First, make a copy of the calendar table (without joining relationships with other tables), and then use the fields in the copied calendar table to replace the original x-axis.
Then, can try below measure in bar chart:
Measure =
CALCULATE(
SUM(Table[Value]),
PARALLELPERIOD(Calendar[Date],0,YEAR),
TREATAS(VALUES(Calendar_Copy[Date]),Calendar[Date])
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
You can adapt the techniques described in https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |