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.
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.
User | Count |
---|---|
87 | |
84 | |
36 | |
35 | |
32 |
User | Count |
---|---|
96 | |
75 | |
67 | |
52 | |
52 |