Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kasife
Helper V
Helper V

Week per month

Hi guys.

 

I'm trying to create a calculated column that gives me the week of the month according to the calendar of the year. As shown in the image below, we can see that the 1st week of August starts on the 1st and ends on the 6th.

kasife_1-1696291604272.png

I am using the following measure, but it is not working

SemanaDoMes = 
VAR DataAtual = [Date]
VAR PrimeiroDiaDoMes = DATE(YEAR(DataAtual), MONTH(DataAtual), 1)
VAR DiaDaData = DAY(DataAtual)
VAR DiaDaSemana = WEEKDAY(PrimeiroDiaDoMes)
VAR DiasNoPrimeiraSemana = 7 - DiaDaSemana + 1
VAR Semana = INT((DiaDaData - DiasNoPrimeiraSemana) / 7) + 1
RETURN
 IF(DiaDaData <= DiasNoPrimeiraSemana, "1ª Semana", Semana & "ª Semana")

This is the result it is returning to me

kasife_2-1696291760383.png

How could I adjust this measurement?

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Simple enough,

ThxAlot_0-1696298227423.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Simple enough,

ThxAlot_0-1696298227423.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



@ThxAlot This worked perfectly. Thanks

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors