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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Kreator
New Member

Dynamic Summarize/Filter Formula

I'm working on visualizing the updated user journey, and I've come up with a formula that provides accurate results when the full date range is selected. However, I've noticed that the formula doesn't adapt correctly when the date range is narrowed down. Any insights would be greatly appreciated.


Formula
COUNTROWS
(   
    SUMMARIZE(
        FILTER(
            'Table',
            'Table'[date] = CALCULATE(MAX('Table'[date]), ALLEXCEPT('Table', 'Table'[Customer_ID], 'Table'[Journey_ID]))
        ),     
        'Table'[Customer_ID]  
    )
)
Formula Explanation
I'm filtering the table to have the max date per each customer and journey, then I'm counting the customers, the missing part is to have the max dates that are within the selected date range in the slicer


The case that works (only yellow lines are shown when full date range is selected)
Screenshot (3).png

The case that I need help with (if only grey dates are selected I want to show the green lines only)
Screenshot 2023-12-19 165735.png

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @Kreator

 

Based on your description, please try the following steps:

 

1. Create a calculated table as follows.

Date = VALUES('Table'[Date])

vxuxinyimsft_0-1703147190834.png

 

2. Create several measures as follow.

MaxDate = 
CALCULATE (
    MAX ( 'Table'[Date] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Journey_ID], 'Table'[Customer_ID] ),
        [Date] >= MIN ( 'Date'[Date] )
            && [Date] <= MAX ( 'Date'[Date] )
    )
)
Measure = IF(SELECTEDVALUE('Table'[Date]) = [MaxDate], 1, 0)
count = COUNTROWS(SUMMARIZE(FILTER('Table', [Date] = [MaxDate]),'Table'[Journey_ID]))

 

3. Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_2-1703147468335.png

 

vxuxinyimsft_3-1703147488661.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuxinyi-msft
Community Support
Community Support

Hi @Kreator

 

Based on your description, please try the following steps:

 

1. Create a calculated table as follows.

Date = VALUES('Table'[Date])

vxuxinyimsft_0-1703147190834.png

 

2. Create several measures as follow.

MaxDate = 
CALCULATE (
    MAX ( 'Table'[Date] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Journey_ID], 'Table'[Customer_ID] ),
        [Date] >= MIN ( 'Date'[Date] )
            && [Date] <= MAX ( 'Date'[Date] )
    )
)
Measure = IF(SELECTEDVALUE('Table'[Date]) = [MaxDate], 1, 0)
count = COUNTROWS(SUMMARIZE(FILTER('Table', [Date] = [MaxDate]),'Table'[Journey_ID]))

 

3. Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_2-1703147468335.png

 

vxuxinyimsft_3-1703147488661.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.