March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
168 | |
116 | |
63 | |
57 | |
50 |