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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BW40
Helper I
Helper I

Can I create a DATE( ) formula that my viewers can change?

I created a column to filter our my customer IDs using three conditions based on two date fields, [start date] and [end date].

 

Is there a way to create a formula or DATE field that my viewers can change themselves that I can use in a formula (which will change all of my values on multiple sheets automatically)? My formulas all work as expected but require me to go in and change the two DATE( ) formulas whenever someone wants to look at a different time frame.

 

I want viewers to be able to adjust the start and end dates but the way my conditions are built, a slicer will not work unless I can put it in a formula (since a slicer only looks between two dates).

 

The conditons are:

1. [applied] <= [end date]

2. If NOT ISBLANK([service stop date]) && [service stop date] >= [start date] || ISBLANK([service stop date])

3. NOT ISBLANK[approval date]

1 ACCEPTED SOLUTION

Hi @BW40,

It seems like a common ‘start date’, ‘end date’ range analysis requirement, you can refer the Greg’s blog about some common scenario if it helps:

Before You Post, Read This: start/end date 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
devanshi
Helper V
Helper V

IF (CALENDAR[Date] <>BLANK, MAX[StartDate] && MAX[EndDate],[stopservice])

If it is correct accept answer

BW40
Helper I
Helper I

 @v-shex-msft  I tried to post a mock table last week but it apparently did not go through. It would be easier if we could attach excel files. Please see the sample table below. Some customers can have more than one service but have the same customer ID while those that were not approved still get a customer ID but not a service id.  

 

@DJSwezey  in my program compromise, I broke it down into several sheets with different slicers but the original goal was to include all of the fields on one sheet. The problem is the totals use the same dates differently, some look at those that closed in a range (could be a slicer) and another looks at those that never closed or closed after a period (a slicer would not let me create an OR ISBLANK condition). 

 

For anther row, I need people who applied in a date range (can be a slicer) while another looks at those who applied before a certain date (I made a rough version with a slicer but slicers themselvers would not let me do a <= [end date]). I need something similar for when customer applications were approved. Relying on filters is a little less user-friendly for those I am creating this for. It was more efficient when they could just change a start and end date parameter.

 

CustomerService IDApproval dateStart DateEnd dateSummaryCount
1110/1/202210/1/202211/1/2022Customers5
2210/1/202210/1/20221/5/2023services7
3    2022 approval6
4310/1/202210/1/2022 2023 approval1
4411/1/202211/1/202212/1/20222022 services3
4511/155/202211/15/202212/16/202222/23 services1
391/1/20231/1/20233/6/20232023 services1
2    closed services5
5711/1/202211/1/2022 open services2

 

Hi @BW40,

It seems like a common ‘start date’, ‘end date’ range analysis requirement, you can refer the Greg’s blog about some common scenario if it helps:

Before You Post, Read This: start/end date 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @BW40,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
DJSwezey
Helper I
Helper I

Have you tried incorporating two variables for your selected dates in a date slicer?

For example:

VAR minselecteddate =
    MIN ( Calendar[Date] )
VAR maxselecteddate =
    MAX ( Calendar[Date] )

Then you can filter your calculations to be within these two dates.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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