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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
baijumohan1990
Helper II
Helper II

Showing Measure Value only the First Date & Last Date of the Date Slicer Power Bi

I am working on a Power BI Report (which is in direct query mode with SSAS tabular model as source). I need to create two measures opening base and closing base with below condition.

opening base should be show value only for the minimum date range chosen by the user in the date slicer.

closing base should be show value only for the maximum date range chosen by the user in the date slicer.

For e.g : if user chooses between may 1, 2020 and may 17,2020 opening base will show value only for may 1, 2020 & closing base show value only for may 17th,2020. For other dates value should be 0. I have tried below

Created a measure to get the minimum date of the date slicer.

StartDate = CALCULATE(min('DATE'[DATE]),ALLSELECTED('DATE'[DATE])) 

used this measure as filter in the opening base measure calculation.

openingbase = CALCULATE(sum(MEASUREMENTS[OPENING_BASE]),FILTER('DATE','DATE'[DATE]=[StartDate]))

But this is not working as I am getting opening base value for all the date ranges selected. Any help much appreciated.

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

openingbase=Calculate(sum(MEASUREMENTS[OPENING_BASE]),datesbetween('DATE'[DATE],min('DATE'[DATE]),min('DATE'[DATE])))

Hope this helps


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Thanks for you reply. Its working partially . Now opening base is calcuated only for the mininum date but its replicating across all the date ranges choosed as shown in the below screenshot. Could you please advice?

 

opening.PNG

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @baijumohan1990 ,

 

Would you please try the following measure:

openingbase =
CALCULATE (
    SUM ( 'MEASUREMENTS'[OPENING_BASE] ),
    FILTER ( ALL ( 'MEASUREMENTS' ), 'MEASUREMENTS'[DATE] = MIN ( 'DATE'[DATE] ) )
)

Best Regards,

Dedmon Dai

 

hi ,

I tried it didnt' worked out..

Hi @baijumohan1990 ,

 

In my test data ,  it works well.  Would  you please show us some sample data for test?

 

Best Regards,

Dedmon Dai

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.