Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi everyone,
I am here again with more doubts to solve, can anyone help me? jeje
I need to calculate the weeks Sunday to Saturday.
I did this logic with the normal week of 7 days and Monday to Sunday
Last Week Current Date tmp =
var dies = if (DAY(TODAY()) <> 7, 7, 6)
var data_setmana_anterior = DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())-dies)
return
if(WEEKNUM('Dim Calendar'[Date],2) = WEEKNUM(data_setmana_anterior,2) ,"Last Week",FORMAT(WEEKNUM('Dim Calendar'[Date],2),"00"))
Basically, I think I need a DAX formula to get last week's values between Saturday and Sunday.
Kind regards,
att:JoanElGran
Solved! Go to Solution.
Hi @Anonymous ,
First of all thanks for your help, but what I want is this but the week i want to Sunday to Saturday.
Like this:
Cheers,
Joan
Hi @JoanElGran1899 ,
Here are the steps you can follow:
1. Create calculated column.
Last week weekend =
var _today=TODAY()
var _weektoday=WEEKNUM(TODAY(),1)
var _week1=WEEKDAY('Dim Calendar'[Date],2)
return
IF(
WEEKNUM('Dim Calendar'[Date],1)=_weektoday-1,"Last week",FORMAT(WEEKNUM('Dim Calendar'[Date],1),"00")
)
week1 =
WEEKNUM('Dim Calendar'[Date],1)
Week2 =
FORMAT( WEEKDAY('Dim Calendar'[Date],1),"dddd")
2. Result:
Please click here for the pbix file
Does the result meet your expectations.
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 @JoanElGran1899 ,
Here are the steps you can follow:
1. Create calculated column.
Last week weekend =
var _today=TODAY()
var _weektoday=WEEKNUM(TODAY(),1)
var _week1=WEEKDAY('Dim Calendar'[Date],2)
return
IF(
WEEKNUM('Dim Calendar'[Date],1)=_weektoday-1,"Last week",FORMAT(WEEKNUM('Dim Calendar'[Date],1),"00")
)
week1 =
WEEKNUM('Dim Calendar'[Date],1)
Week2 =
FORMAT( WEEKDAY('Dim Calendar'[Date],1),"dddd")
2. Result:
Please click here for the pbix file
Does the result meet your expectations.
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 @JoanElGran1899 ,
Here are the steps you can follow:
1. Create calculated column.
Last week weekend =
var _today=TODAY()
var _weektoday=WEEKNUM(TODAY(),2)
var _week1=WEEKDAY('Dim Calendar'[Date],2)
return
IF(
WEEKNUM('Dim Calendar'[Date],2)=_weektoday-1 &&_week1 in {6,7},"Last week weekend",FORMAT(WEEKNUM('Dim Calendar'[Date],2),"00")
)
2. Result:
Please click here for the pbix file.
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 @Anonymous ,
First of all thanks for your help, but what I want is this but the week i want to Sunday to Saturday.
Like this:
Cheers,
Joan
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
72 | |
68 | |
41 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |