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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
AshDil
Helper V
Helper V

Want to show only 2nd half of month sales in current 6 months

Hi,

I have sales from jan 2021 to oct 2021, now I want to show 2nd half of month sales (i.e, for Sep month need to show sales from 16/09/2021 to 30/09/2021, for Oct month from 16/10/2021 to 31/10/2021) for current 6 months duration.

 

Please help me to do it.

Thanks,

AshDil.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AshDil , Create a measure like this with help from date table

 


LAst 6 month onlt last 15 days =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

 

or

 

LAst 6 month onlt last 15 days =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

or
LAst 6 month onlt last 15 days =
var _max = eomonth(today(),-1)
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

3 REPLIES 3
FarhanAhmed
Community Champion
Community Champion

You need to Add Filter in your measure.

 

Try Create something like 

 

_Sales 2nd Half = CALCULATE(SUM('Table'[Amount]),FILTER(Date,DAY(Date[Date])>15))

 

 







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

Proud to be a Super User!




amitchandak
Super User
Super User

@AshDil , Create a measure like this with help from date table

 


LAst 6 month onlt last 15 days =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

 

or

 

LAst 6 month onlt last 15 days =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

or
LAst 6 month onlt last 15 days =
var _max = eomonth(today(),-1)
var _min = eomonth(_max,-6) +1
var _day = 16
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max && day('Date'[Date]) >=_day ) )

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

Thanks for your help. It worked for me.

Thanks,

AshDil.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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