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
AshDil
Helper V
Helper V

Want to show Bi-Weekly Sales Dynamically

Hi,

Want to show sales Bi-Weekly dynamically.
eg: if we are in first half of the month then need to show sales from 1/10/2021 to 14/10/2021

and if we are in 2nd half of the month need to show sales from 15/10/2021 to  31/10/2021.

 

Please help me to do.

Thanks,

AshDil.

2 ACCEPTED SOLUTIONS
VahidDM
Super User
Super User

Hi @AshDil 

 

Try to create a measure like this:

Measure=
Var _T = today()
Var _BIW = if(_T<=14,1,2)
Var _Start = if(_T<=14,EOMONTH(_T,-1)+1,Date(Year(_T),Month(_T),15)
Var _Finish = if(_T<=14,Date(Year(_T),Month(_T),14),EOMONTH(_T,0))
return
Calculate(sum(table[Sale]),filter(table,table[date]>=_Start&&table[date]<=_Finish))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

View solution in original post

Hi @VahidDM

 

Thanks for your help. It worked for me with following small modification.

 

Measure=
Var _T = today()
Var _Start = if(Day(_T)<=14,EOMONTH(_T,-1)+1,Date(Year(_T),Month(_T),15)
Var _Finish = if(Day(_T)<=14,Date(Year(_T),Month(_T),14),EOMONTH(_T,0))
return
Calculate(sum(table[Sale]),filter(table,table[date]>=_Start&&table[date]<=_Finish))

 

Thanks,

AshDil.

 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @AshDil 

 

Try to create a measure like this:

Measure=
Var _T = today()
Var _BIW = if(_T<=14,1,2)
Var _Start = if(_T<=14,EOMONTH(_T,-1)+1,Date(Year(_T),Month(_T),15)
Var _Finish = if(_T<=14,Date(Year(_T),Month(_T),14),EOMONTH(_T,0))
return
Calculate(sum(table[Sale]),filter(table,table[date]>=_Start&&table[date]<=_Finish))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

Hi @VahidDM

 

Thanks for your help. It worked for me with following small modification.

 

Measure=
Var _T = today()
Var _Start = if(Day(_T)<=14,EOMONTH(_T,-1)+1,Date(Year(_T),Month(_T),15)
Var _Finish = if(Day(_T)<=14,Date(Year(_T),Month(_T),14),EOMONTH(_T,0))
return
Calculate(sum(table[Sale]),filter(table,table[date]>=_Start&&table[date]<=_Finish))

 

Thanks,

AshDil.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.