Hello,
I'm new to power BI and I need to show current week and previous week cases (specifically 10/24/2021 - 10/30/21 and 10/17/2021 - 10/23/2021) with a graph in desktop. I tried a couple of different date tables, but I'm unable to figure it out. The count for the current week cases is 10 and the previous week is 15. The file is .csv. The last case number is 21-0104 and last date is 10/26/2021 for table.
Case Number | Opened |
21-001 | 8/24/2021 |
21-002 | 8/24/2021 |
21-003 | 8/24/2021 |
21-004 | 8/26/2021 |
21-005 | 8/26/2021 |
21-006 | 8/27/2021 |
21-007 | 8/30/2021 |
21-008 | 8/30/2021 |
21-009 | 8/30/2021 |
Solved! Go to Solution.
Hi @redwood2021 ,
Your picture can't be displayed...
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _todayweek=WEEKNUM(TODAY())
return
IF(
WEEKNUM(MAX('Table'[Opened]))>=_todayweek-1&&WEEKNUM(MAX('Table'[Opened]))<=_todayweek,1,0)
2. Put [Measure] into Filter and set is=1.
3. Result:
The data displayed is the current week and last week
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 @redwood2021 ,
Your picture can't be displayed...
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _todayweek=WEEKNUM(TODAY())
return
IF(
WEEKNUM(MAX('Table'[Opened]))>=_todayweek-1&&WEEKNUM(MAX('Table'[Opened]))<=_todayweek,1,0)
2. Put [Measure] into Filter and set is=1.
3. Result:
The data displayed is the current week and last week
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
@redwood2021 Add a WEEKNUM column and a YEAR column. Then you can do this:
Current Week Cases =
VAR __Year = MAX('Table'[Year])
VAR __Weeknum = MAX('Table'[Weeknum])
RETURN
COUNTROWS(ALL('Table'),[Year]=__Year && [Weeknum]=__Weeknum)
Previous Week Cases =
VAR __Year = MAX('Table'[Year])
VAR __Weeknum = MAX('Table'[Weeknum])
RETURN
COUNTROWS(ALL('Table'),[Year]=__Year && [Weeknum]=__Weeknum-1)
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!
User | Count |
---|---|
366 | |
102 | |
65 | |
51 | |
49 |
User | Count |
---|---|
342 | |
120 | |
83 | |
68 | |
62 |