Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I have a line chart and I only need it to show the last rolling 2 weeks of data. I have put a date filter on (using the date table) and the line chart X-axis used week no and period no from the sales table. Its pulling through incorrectly in terms of showing zeros for anything beyond 12 weeks when I want it to start on the line chart from the week 202335 (end of 202308) How can I make this work?
Solved! Go to Solution.
@lennox25 , if you have selected 12 weeks and it shows 0 for all other weeks, means you are using +0 or coalesce or blank handling in your measure avoid that.
In case you are adding +0 for in between range data try like
0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1)
Hi @lennox25 ,
I created some data:
Here are the steps you can follow:
1. Create slicer table.
Slicer =
DISTINCT('Table'[year_week])
2. Create measure.
Measure =
var _select=SELECTEDVALUE('Slicer'[year_week])
var _maxdate=MAXX(FILTER(ALL('Table'),'Table'[year_week]=_select),[Date])
var _mindate=DATE(YEAR(_maxdate),MONTH(_maxdate)-3,DAY(_maxdate))
return
IF(
MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,SUMX('Table','Table'[rand]),BLANK())
3. 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
Hi @lennox25 ,
I created some data:
Here are the steps you can follow:
1. Create slicer table.
Slicer =
DISTINCT('Table'[year_week])
2. Create measure.
Measure =
var _select=SELECTEDVALUE('Slicer'[year_week])
var _maxdate=MAXX(FILTER(ALL('Table'),'Table'[year_week]=_select),[Date])
var _mindate=DATE(YEAR(_maxdate),MONTH(_maxdate)-3,DAY(_maxdate))
return
IF(
MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,SUMX('Table','Table'[rand]),BLANK())
3. 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
@lennox25 , if you have selected 12 weeks and it shows 0 for all other weeks, means you are using +0 or coalesce or blank handling in your measure avoid that.
In case you are adding +0 for in between range data try like
0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
92 | |
86 | |
85 | |
66 | |
49 |
User | Count |
---|---|
140 | |
113 | |
106 | |
64 | |
60 |