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
TD21
Helper II
Helper II

Cumulative Count based on multiple criteria

Need assitance calculating cumulative count with multiple filtering criteria to be used in a chart.

 

I'm working with 2 tables:

Table #1: DATE_MASTER (it's a date table)

Table #2: SALES_EXPORT (contains the following fields)

  • ORDER_DATE
  • CUSTOMER_NAME
  • GENDER
  • CHANNEL (i.e. Web, Mobile App, Store)
  • SHIPPING_METHOD (i.e. Store pick-up, UPS, Fedex)

Below is my measure to calculate cumulative count:

 

SALES_CUMULATIVE_COUNT:=
IF (
MIN ( DATE_MASTER[Date] ) <= CALCULATE ( MAX ( [ORDER_DATE] ), ALL ( SALES_EXPORT ) ),
CALCULATE (
COUNTX ( SALES_EXPORT, [ORDER_DATE] ),
USERELATIONSHIP ( DATE_MASTER[Date], SALES_EXPORT[ORDER_DATE] ),
FILTER (
DATE_MASTER,
DATE_MASTER[Date] >= DATE ( 2019, 1, 1 ) && DATE_MASTER[Date] <= MAX ( DATE_MASTER[Date] )
)
)
)

 

I would like to calculative the cumulative count of sales by Female, using Mobile App, but picked up in the store. How do I tweak my measure to include GENDER = 'F' && CHANNEL = 'Mobile App' && 'SHIPPING_METHOD' = 'Store pick-up'?

 

Thanks in advance.

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@TD21 ,

 

You may modify the measure like below:

SALES_CUMULATIVE_COUNT :=
IF (
    MIN ( DATE_MASTER[Date] )
        <= CALCULATE ( MAX ( [ORDER_DATE] ), ALL ( SALES_EXPORT ) ),
    CALCULATE (
        COUNTX ( SALES_EXPORT, [ORDER_DATE] ),
        USERELATIONSHIP ( DATE_MASTER[Date], SALES_EXPORT[ORDER_DATE] ),
        FILTER (
            DATE_MASTER,
            DATE_MASTER[Date] >= DATE ( 2019, 1, 1 )
                && DATE_MASTER[Date] <= MAX ( DATE_MASTER[Date] )
                && DATE_MASTER[GENDER] = "F"
                && DATE_MASTER[CHANNEL] = "Mobile App"
                && DATE_MASTER[SHIPPING_METHOD] = "Store pick-up"
        )
    )
)

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuta-msft 

 

The post didn't help because you didn't read my question correctly. It CANNOT be marked as a Solution; that'd be confusing to other readers.

@v-yuta-msft 

 

If you look at my original post, you'll see that [GENDER], [CHANNEL], and [SHIPPING_METHOD] are NOT in the DATE_MASTER table.

 

Basically, I am look for ways to filter based on fields in 2 different tables:

1. DATE_MASTER - [Date]

2. SALES_EXPORT - [Gender], [Channel], [Shipping_Method]

 

Thanks.

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.