Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Not sure why I can't figure this one out as it seems very simple but I just want to have a visual card at the top of my page that will show the last weeks dates. I have a table that is filtered by previous week dates via a sql query and I don't actually have any date fields in my data model for the data itself. I do however have a DateTable setup with Start of week and End of Week dates. Our week starts on a Monday and ends on Sunday.
Thank you for any help or advice you can give.
Solved! Go to Solution.
@MP-iCONN , A measure like
=
var _st = today() +-1*WEEKDAY(today() ,2)+1 -7
var _end = today() + 7-1*WEEKDAY(today(),2) -7
return _st & " to " & _end
Use format to format the date in the required format
@MP-iCONN , You should create a week/date table with YearWeek (YYYYWW) , Then you can create week rank in week/date table and try measure like
new column
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Lets say for example I just have a DateTable and no other Data. My actual data is already filtered and showing everything I need in the table. I however do not have any dates in that Data table. I just want to show text in a card that represents the dates 02/07/22 - 02/13/22. I am just trying to show in this report what dates are in last weeks Date Range so they know exactly what my data represents.
For Example:
@MP-iCONN , A measure like
=
var _st = today() +-1*WEEKDAY(today() ,2)+1 -7
var _end = today() + 7-1*WEEKDAY(today(),2) -7
return _st & " to " & _end
Use format to format the date in the required format
That worked perfect, thank you.
My final measure was:
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |