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.
I am working on a dax function where the requirement is
Requirement: I select a quarter value from slicer and my line chart shows data for the last 8 quarters.
Additional requirement: If there is no data for a specific quarter the data should show 0 on the line chart
My work: I did create another calendar table called previous dates and here is my dax.
Where there is no data for all 8 quarters from a selected quarter:
Despite no values for all 8 quarters, I want the values to all show up on the chart and show as 0.
Your ideas on this is much appreciated.
Solved! Go to Solution.
@ManojMunjeti , if you select one qtr and what to show more than that you need an independent date table in the slicer
example
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -24) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
refer
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
@ManojMunjeti , if you select one qtr and what to show more than that you need an independent date table in the slicer
example
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -24) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
refer
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |