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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Traceout
Frequent Visitor

Need help with a measure when selecting more than one category in a slicer.

Here's what I'm looking at. I want to get a rolling number of customers impacted.

 

1. The customers are broken up into different zones.

2. Each impact has a start_date and an End_date and customers. 

3. If the start date of an impact is after the end_date of a previous impact, the customers of the previous impact are no longer added into the rolling customers impacted.

For example:

 
 

Traceout_6-1671216975983.png

I have the following measure: 

 

Rolling Customers Impacted2 =
VAR currentStartDate = SELECTEDVALUE('Sheet2'[Start_Date])
RETURN
    CALCULATE(
        SUM(Sheet2[Customers]),
        ALLEXCEPT(Sheet2,Sheet2[Zone]),
        'Sheet2'[Start_Date] <= currentStartDate,
        'Sheet2'[End_date] >= currentStartDate
    )

 

When I select one zone in the slicer it calculates the running customers correctly but when I select two or more zones it calculates the running customers for each zone instead of combining the zones and doing a running total by start_date. 

 

Example data: 

Example1: 

When 1 zone is selected: 

Traceout_1-1671216289625.png

 

Example2:

When 2 zones are selected: 

sorted by date

Traceout_2-1671216670185.png

Sorted by zone: 

Traceout_3-1671216700850.png

As you can see it's calculating each zone independently which is what it should be doing but I'm not sure how to get the result I'd like. 

 

Example 3: When sorting by 2 or more zones - What I'm aiming for: 

Traceout_0-1671217723590.png

 

 

Any help would be much appreciated! Thanks!

 

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @Traceout ,

 

Can you provide the relevant test data so that I can answer your question as soon as possible? Looking forward to your reply.


Best Regards,
Henry

 

@v-henryk-mstf 

 

I've attached a .pbix with the test data. Let me know if you have any questions, I appreciate the help. 

 

https://drive.google.com/file/d/1g3LLsJH9xkmJc0PN0OVWOzmbL4IGYm9x/view?usp=sharing

Traceout
Frequent Visitor

I should probably also mention that there are more than 2 zones. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.