Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
file: bi
hi guys please help me i cant visual last week of previous month (e.g. W4 or W5) after select this month
when i select"Aug" &"W1" -> on the "Last Week" table it should show Energy dar 138 not a blank
above code is a filter for last week
these two above picture is hown data
ps. i attach file in link pi bi
Solved! Go to Solution.
Hi @peoplehelpme ,
I suggest you to try an unrelated table and measures to filter your visuals.
DimDate =
SUMMARIZE (
'Table',
[Date],
[Week num from 2020],
[Week num in month],
"Year", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "MMM" ),
"MonthSort", MONTH ( [Date] )
)
Measure:
Current Week =
VAR _DAYLIST = VALUES(DimDate[Date])
RETURN
IF(MAX('Table'[Date]) IN _DAYLIST,1,0)
Last Week =
VAR _SELECTWEEKNUM = SELECTEDVALUE(DimDate[Week num from 2020])
RETURN
IF(MAX('Table'[Week num from 2020]) = _SELECTWEEKNUM -1 ,1,0)
Add measure into visual level filter to filter two table visuals.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ok sir, thank you for your time
1) i want to show last week data and this week data ; here is example
Date | Item | Week num in month | Week num from 2020 |
31Dec2020 | A | W5 | 52 |
1Jan2021 | B | W1 | 53 |
2Jan2021 | C | W1 | 53 |
3Jan2021 | D | W1 | 53 |
4Jan2021 | E | W1 | 53 |
5Jan2021 | F | W1 | 53 |
6Jan2021 | G | W1 | 53 |
7Jan2021 | H | W1 | 53 |
8Jan2021 | I | W2 | 54 |
9Jan2021 | J | W2 | 54 |
10Jan2021 | K | W2 | 54 |
i create filter "Week num in month", "Month" (extract from 'Date') , "Year"(extract from 'Date')
this is scenario
1)
i choose "W2" and "Jan" and "2021" ->
result of last week are "B","C",...,"H" .
result of this week are "I","J","K"
2)
i choose "W1" and "Jan" and "2021" ->
result of last week are "A"
result of this week are "B","C",...,"H"
Hi @peoplehelpme ,
I suggest you to try an unrelated table and measures to filter your visuals.
DimDate =
SUMMARIZE (
'Table',
[Date],
[Week num from 2020],
[Week num in month],
"Year", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "MMM" ),
"MonthSort", MONTH ( [Date] )
)
Measure:
Current Week =
VAR _DAYLIST = VALUES(DimDate[Date])
RETURN
IF(MAX('Table'[Date]) IN _DAYLIST,1,0)
Last Week =
VAR _SELECTWEEKNUM = SELECTEDVALUE(DimDate[Week num from 2020])
RETURN
IF(MAX('Table'[Week num from 2020]) = _SELECTWEEKNUM -1 ,1,0)
Add measure into visual level filter to filter two table visuals.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@carade9 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
79 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |