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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Megz
Helper I
Helper I

Need to accommodate date slicer in cumulative total measure

Hi There,

 

I started off with only one year of data and the following measure works to calculate a reverse cumulative total showing how sales rise as the time remaining to sell (selling time weeks) decreases.

 

cumulative sales 2 =

CALCULATE(
  COUNTA('GS_OE_Bookings'[sales_time_weeks]),
  FILTER(
    ALLSELECTED(GS_OE_Bookings),
    GS_OE_Bookings[sales_time_weeks] >= MIN(GS_OE_Bookings[sales_time_weeks])
  )
)
 

Now I have added data spanning a number of years, along with a calendar table which has the relationship 'Course date'[Date] / GS_OE_Bookings[start_date].  I also now have a slicer slicing on 'Course date'[Year]. The code above still works when all the years available are selected in the slicer.....

 

Megz_0-1689062541236.png

 

However when I select a year in the slicer, the cumulative total still kind of works but there are records hanging around that aren't relevant to the year selected...

 

Megz_3-1689009589301.png

How can I change the measure to prevent these extra records showing up?  

Any help greatly appreciated.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Megz,

Did the filter source field also include in your table? If that is the case, you may need to create a new table as source of slicer or use ALL function to replace ALLSELECTED to break the current relationship. (power bi use AND logic to link different filters)

Then you can manually apply filter condition in expression that extract from the filter selection.

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @Megz,

Did the filter source field also include in your table? If that is the case, you may need to create a new table as source of slicer or use ALL function to replace ALLSELECTED to break the current relationship. (power bi use AND logic to link different filters)

Then you can manually apply filter condition in expression that extract from the filter selection.

Regards,

Xiaoxin Sheng

Hi Xiaoxin - Thanks for taking a look

I will take a look at your suggestion - I'm on vacation for a week or so but I'll be back on this.

I've been reading this as well but haven't got round to trying it. https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/The-Complex-Selector/td-p/1116633 

Anonymous
Not applicable

Hi @Megz,

OK, you can feel free to post if you faced any issue about this scenario.
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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