How to use weekday function power bi with example

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:

weekday function power bi

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.

power bi weekday text

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.

weekday function power bi

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.

extract weekday from date power bi

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.

weekday function power bi with example

Also you may like the below Power BI articles:

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.

>