Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
What do I need to do to not have this Line and Stacked Column not show Years and Months not seleleted by Slicer. All the 0 data at the beginning?
I only selected last 3 years of possible 7 years for this visual.
Hi @bdehning ,
Here are the steps you can follow:
1. Create calculated table.
Date=
var _table1=
CALENDAR(
MIN('Table'[Date]),
MAX('Table'[Date]))
var _table2=
SUMMARIZE(
_table1,[Date],"Year-Month",YEAR([Date])&"-"&FORMAT([Date],"mmmm"),"Rank",RANKX(_table1,[Date],,ASC))
return
FILTER(
_table2,
[Rank]=MINX(FILTER(_table2,[Year-Month]=EARLIER([Year-Month])),[Rank]))
2. Select [Year-Month] – Sort by column – [Rank].
3. Create measure.
Flag =
var _select=SELECTCOLUMNS('Date',"slicer",'Date'[Year-Month])
var _sum=SUMX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),[Value])
return
IF(
YEAR(MAX('Table'[Date]))&"-"&FORMAT(MAX('Table'[Date]),"mmmm") in _select
||AND(_sum <>0,NOT(YEAR(MAX('Table'[Date]))&"-"&FORMAT(MAX('Table'[Date]),"mmmm")) in _select)
,1,BLANK())
4. Place [Flag]in Filters, set is=1, apply filter.
5. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
I should have expained this better maybe. Users will select the Year or Years of data they want to see, which are not Calendar Years and are based upon the Account they pull up. That is why I have seperate columns for Years and Months. I do want to restrict the amount of months to 72 to fit the visual.
Column Y Axis and Line y-Axis are both Count.
How does this affect what you sent?
Hi @bdehning
It is very challenging to understand the problem without seeing the data.
Please refer to the linked tutorial about the issue if it doesn't help, please attach the link to some dummy pbix.
https://www.enjoysharepoint.com/power-bi-show-items-with-no-data/
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
79 | |
58 | |
35 | |
34 |
User | Count |
---|---|
99 | |
59 | |
56 | |
46 | |
40 |