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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Saipreethi
Helper I
Helper I

Every month 1st week wednesday data should reflect

Hi everyone,


1st week (wednesday) of Every month data should reflect last months data. For eg: First week is October 5th( wednesday) and the data should reflect last month september data. Till October 4th it should show August data only. The same should be applied for entire year. Can anyone help me with the DAX.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Saipreethi ,

Assuming this based on today and you need full month data

 

var _mo = eomonth(today(), -1) +1

var _wed = _mo - Weekday(_mo,2) +3

var _final = if(_web<_mo, _wed +7, _wed)

return

if(day(_wed) <5, calculate(Sum(Table[Value]), filter(Table, Eomonth(Table[Date],0)  =eomonth(today(), -2)) ),

calculate(Sum(Table[Value]), filter(Table, Eomonth(Table[Date],0)  =eomonth(today(), -1)) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1665651951868.png

 

 

In order to create a calculated column that suits your business requirement is to author a calculated column like below inside the calendar table.

 

Jihwan_Kim_1-1665652030542.png

 

New Month-Year CC = 
VAR _currentcalendarmonthyear = 'Calendar'[End of Month]
VAR _startingwednesday =
    MINX (
        FILTER (
            'Calendar',
            'Calendar'[End of Month] = _currentcalendarmonthyear
                && 'Calendar'[Day Name] = "Wednesday"
        ),
        'Calendar'[Date]
    )
RETURN
    IF (
        'Calendar'[Date] >= _startingwednesday,
        'Calendar'[Month-Year],
        FORMAT('Calendar'[Start of Week], "mmm-yyyy")
    )

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@Saipreethi ,

Assuming this based on today and you need full month data

 

var _mo = eomonth(today(), -1) +1

var _wed = _mo - Weekday(_mo,2) +3

var _final = if(_web<_mo, _wed +7, _wed)

return

if(day(_wed) <5, calculate(Sum(Table[Value]), filter(Table, Eomonth(Table[Date],0)  =eomonth(today(), -2)) ),

calculate(Sum(Table[Value]), filter(Table, Eomonth(Table[Date],0)  =eomonth(today(), -1)) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.