cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
fbostan1
Frequent Visitor

Help with Access Formula into PowerBI Dax

Hi,

 

I need help with this formula I have from Access which I want to convert it into PowerBI Dax.

Access formula =IIf(Weekday(Date()) Between 2 And 3,Date()-4,Date()-2) 

Numbers for weekdays Sunday =1 Monday =2 Tuesday =3 Wednesday=4 Thursday =5 Friday =6 Saturday =7

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @fbostan1 ,

 

Not sure about the Access syntax, but I'll give it a try:

TomsCalculatedColumn = 
IF ( WEEKDAY('date'[Dates] ) = 2 || WEEKDAY('date'[Dates] ) = 3, 'date'[Dates] -4, 'date'[Dates] -2 )

I assumed that "Date()" is a date column.

 

If "Date()" is a function for today's date, then you can use this one:

TomsMeasure = 
IF ( WEEKDAY(TODAY() ) = 2 || WEEKDAY(TODAY() ) = 3, TODAY() -4, TODAY() -2 )

 

Hope this helps!

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
fbostan1
Frequent Visitor

Awesome! worked perfectly, thank you so much!

I also need help with this, I want to write a Dax formula for

(If ORDR_DATE is between Rx Direct and Rx Direct End then "Y" else "N")?

fbostan1_0-1647545779303.png

 

tackytechtom
Super User
Super User

Hi @fbostan1 ,

 

Not sure about the Access syntax, but I'll give it a try:

TomsCalculatedColumn = 
IF ( WEEKDAY('date'[Dates] ) = 2 || WEEKDAY('date'[Dates] ) = 3, 'date'[Dates] -4, 'date'[Dates] -2 )

I assumed that "Date()" is a date column.

 

If "Date()" is a function for today's date, then you can use this one:

TomsMeasure = 
IF ( WEEKDAY(TODAY() ) = 2 || WEEKDAY(TODAY() ) = 3, TODAY() -4, TODAY() -2 )

 

Hope this helps!

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors