Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
HI everyone.
I want to show Current week as default when user open the report or changes the report page.
I want this slicer to show by default whenever user opens the report or changes the report page. when user come backs to the page it should show the sales by current week.
PFB the dax im using currently to show the current week between the weeks,
Solved! Go to Solution.
Hi @Saadii_360
First you need to create a calculated column to return the week number and put the column in slicer to filter data .
week number=
var _number=WEEKNUM('Table'[Date])
var _today=WEEKNUM(TODAY())
return SWITCH(TRUE(),_number=_today,"Current",FORMAT(_number,"####"))
In the formula above , _number is the week number of each date , _today is the week number of today . When _number is equal to _today , you will get the dates belong to current week and return the value with text “current” .
Then create a measure to sum the value .
total value = SUM('Table'[Value])
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Saadii_360
First you need to create a calculated column to return the week number and put the column in slicer to filter data .
week number=
var _number=WEEKNUM('Table'[Date])
var _today=WEEKNUM(TODAY())
return SWITCH(TRUE(),_number=_today,"Current",FORMAT(_number,"####"))
In the formula above , _number is the week number of each date , _today is the week number of today . When _number is equal to _today , you will get the dates belong to current week and return the value with text “current” .
Then create a measure to sum the value .
total value = SUM('Table'[Value])
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Saadii_360 , the Issue is not clear.
But you need have start of week
start week = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday
end date= 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Then you can create a new column like
Week Type = Switch( True(),
WEEKNUM("Datedim"[entrydate] ) = WEEKNUM( TODAY() ),"This Week" ,
WEEKNUM("Datedim"[entrydate] ) = WEEKNUM( TODAY() )-1,"Last Week" ,
[Week Name]
)
Create these in date table and save on this week. As of now you can not default it using a measure/funtion
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |