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
Coryanthony
Helper III
Helper III

Please Help! Bookmarks issue.

Hello, i've been trying to figure this out for a week now with no luck. 

I have 3 bookmarks for time period (6 months, 1 year & 2 year). When I select my bookmark, the current employee id resets. I want to be able to select an employee, then use the bookmark for the time period w/out having to find the employee id again.

 

In the picute below, i am reviewing employee id 112233 (John Doe), when i select the bookmark time period, it reset to an employee ID no longer in my data source. 

Coryanthony_0-1673970861429.png

Coryanthony_1-1673970894907.png

i've tried multiple bookmarks e.g selected visual, all visual. i am giving up 😞

 

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Coryanthony 

 

There are different ways to do it. Please find below a starting point. In the end to really help you we need to see your data model with input sample data and expected output incl. your definition of last 6 months. For example to you calculate it on day or month granularity etc.

 

Time Intelligence | L6M = 
    VAR __ReferenceDate = MAX(Dim_Date[Date])
    VAR __StartDate = EDate(__ReferenceDate,-6) + 1
    VAR __Table = FILTER(ALL(Dim_Date), [Date] >=__StartDate && [Date]<=__ReferenceDate)
    VAR __Result = SUMX(__Table,SUM(Fact_Sales[Value]))
    RETURN
    __Result

 

or

 

Time Intelligence | L6M = 
var var_ReferenceDate = LASTDATE('Dim Date'[Date])
var var_StartDate = STARTOFMONTH(DATEADD(var_ReferenceDate ,-5,MONTH))

RETURN

CALCULATE(
    SUM(FactSales[Value]),    
    DATESBETWEEN('Dim Date'[Date],var_StartDate,var_ReferenceDate)
)

 

Mikelytics_0-1673974519465.png

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

5 REPLIES 5
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Coryanthony 

 

There are different ways to do it. Please find below a starting point. In the end to really help you we need to see your data model with input sample data and expected output incl. your definition of last 6 months. For example to you calculate it on day or month granularity etc.

 

Time Intelligence | L6M = 
    VAR __ReferenceDate = MAX(Dim_Date[Date])
    VAR __StartDate = EDate(__ReferenceDate,-6) + 1
    VAR __Table = FILTER(ALL(Dim_Date), [Date] >=__StartDate && [Date]<=__ReferenceDate)
    VAR __Result = SUMX(__Table,SUM(Fact_Sales[Value]))
    RETURN
    __Result

 

or

 

Time Intelligence | L6M = 
var var_ReferenceDate = LASTDATE('Dim Date'[Date])
var var_StartDate = STARTOFMONTH(DATEADD(var_ReferenceDate ,-5,MONTH))

RETURN

CALCULATE(
    SUM(FactSales[Value]),    
    DATESBETWEEN('Dim Date'[Date],var_StartDate,var_ReferenceDate)
)

 

Mikelytics_0-1673974519465.png

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Rudy_D
Resolver I
Resolver I

Hi,

 

I think you have to unselect the bookmark option 'data'.

 

Regards

@Rudy_D 

Hi Rudy,

Whenever i unselect the option 'data', it no longer recognize the date filter. It does not apply the date filter when 'data' is unselected.

 

Coryanthony_0-1673972463169.png

 

 

 

Hi @Coryanthony 

 

It is only possible to store the whole filter context in the bookmark (Data activated) or no of the filter context (Data inactivated).

 

If you want to show last year etc. the typical way would be to implement this in your measure logic using time intelligence functions with or without slicers depending on your needs

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

@Mikelytics 

Thank you Michael. Do you have any suggestion on how i can make this work? I am wanting to see employee expenses in a 6month, 1year and 2 year period. 

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.