In this Microsoft Power BI Tutorial, we will discuss weekday function power bi. We will discuss how to get last week’s Friday Date using Power BI DAX.
Also, We will see how to get the last week’s Friday’s Date with YYYYMMDD format using Power BI DAX.
Suppose, this is a week and today is Thursday. I want to get the last Friday’s date from my last week.
weekday function power bi
Follow the below steps to know how to use weekday function power bi and we will see how to get last week’s Friday date in Power BI.
Step-1: (Create a New measure)
Create a New measure by right-clicking on the table in Power BI. If you are new to Power BI Measure, then follow the below link:
Step-2: (Apply the Measure formula)
Once you will create the new measure, a formula bar will appear on the Power BI Desktop page.
In the formula bar, apply the below formula to get the last week’s Friday’s date.
Report Header = "WEEKLY SALES PERFORMANCE as of "&format(IF(WEEKDAY(TODAY(),16),TODAY()-WEEKDAY(TODAY(),16),TODAY()-7),"MMM DD, YYYY")
Also, you can refer the below screenshot to understand better.
Step-3: (Test the Power BI Measure)
To test the Power BI Measure (Report Header) formula, take a card from the Visualizations section as shown below.
Now put the New measure (Report Header) into the Fields section of the Card. Once you put it, then you can see the header will appear as the below screenshot.
weekday function Power BI example DAX
The below Power BI DAX formula is used to retrieve the last week Friday’s Date with YYYYMMDD format.
In the same way you can create a new measure and apply the below formula.
Report Header = "WEEKLY SALES PERFORMANCE as of "&format(IF(WEEKDAY(TODAY(),16),TODAY()-WEEKDAY(TODAY(),16),TODAY()-7),"YYYY-MM-DD")
Once you will put the measure in a Card, then the last friday date will appear with YYYYMMDD format as you can see in the below screenshot.
Also you may like the below Power BI articles:
- Get Month Name from Month Number in Power BI
- Get Next Month Sales Report in Power BI
- Power BI report using People Picker Field
- Get Current Month Sales Report using Power BI Measure
- Power BI Measure Sum and Subtract Example
- Subtraction in Power bi using DAX
- Power BI nan error (Not a number) while dividing by Zero
- Scheduled Power BI report data refresh
- Power bi shared dataset permissions management
- Power bi table visualization
- What is the difference between calculated column and measure in Power BI
Hence in this Microsoft Power BI Tutorial, We discussed how to use the weekday function power bi with example. We saw how to get the last week’s Friday’s Date using Power BI DAX.
Also, We saw how to get the last week’s Friday’s Date with YYYYMMDD format using Power BI DAX.
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com