Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear all,
I have a table with dates from Novembre 2017 and October 2018.
On April 2018 I have no data
Power BI Desktop has Time Intelligence option enabled and date hierarchy is fine.
Result is like that
As you can see no bar for April 2018.
If I choose "Show Items with no data", I get this
As you can see April is shown with no data, but I have other months I do not need (Jan-Oct 2017 and Nov-Dec 2018).
Is there a way to filter/customize the chart to show me only Nov 2017 - Oct 2018 and April 2018 (wih no data) like below?
Thanks
Kind regards
Solved! Go to Solution.
If you can create a Date table (if you don't already have one - you can just google "How to create Date Table in Power BI"), this can be easily achieved with some DAX:
Continuous Measure = VAR MainMeasure = SUM ( 'Table'[Amount] ) VAR CurrentDate = MAX ( 'Calendar'[Date] ) VAR MaxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALL ( 'Calendar' ) ) VAR MinDate = CALCULATE ( MIN ( 'Table'[Date] ), ALL ( 'Calendar' ) ) RETURN IF ( ISBLANK ( MainMeasure ) && CurrentDate <= MaxDate && CurrentDate >= MinDate, 0, MainMeasure )
Here Table[Date] is the date column in your Fact/Data table, and Calendar[Date] is you Date dimension table, and you create a relationship between these 2.
If you can create a Date table (if you don't already have one - you can just google "How to create Date Table in Power BI"), this can be easily achieved with some DAX:
Continuous Measure = VAR MainMeasure = SUM ( 'Table'[Amount] ) VAR CurrentDate = MAX ( 'Calendar'[Date] ) VAR MaxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALL ( 'Calendar' ) ) VAR MinDate = CALCULATE ( MIN ( 'Table'[Date] ), ALL ( 'Calendar' ) ) RETURN IF ( ISBLANK ( MainMeasure ) && CurrentDate <= MaxDate && CurrentDate >= MinDate, 0, MainMeasure )
Here Table[Date] is the date column in your Fact/Data table, and Calendar[Date] is you Date dimension table, and you create a relationship between these 2.
Thank you very much.
It works.