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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Invesco
Helper V
Helper V

Filtering Issue Many to many Relationship date Table

Hi Experts

 

See model below (image) - I am using date_day from 02 | Calendar table as a date between filter and Products from dev_con_hcp_universe table - but i am unable to filter the matrix table as shown below when i select a particular product from the drop down slicer...


Relationship links

02 | Calendar Table link to Dev_con_consent via Day_id to Capture_day_id

 

Dev-con_consent links to Dev_con_hcp_universe via Crmf_hcp_id to Crrmf_hcp_id (many-to-many)

 

Model:

Invesco_0-1663738383533.png

 

Table not filtering

Invesco_1-1663738413859.png

HCP Type (dev_con_hcp_universe) Table and Month from 02 | Calendar Table 

 

 

Measure(s) used in matrix Table:

HCP Type Consent # =
VAR _table = SUMMARIZE(dev_con_hcp_universe_flipped,[hcp_type],"__Value",[Total Consent])
Return
IF(HASONEVALUE(dev_con_hcp_universe_flipped[hcp_type]),[Total Consent],SUMX(_table,[Total Consent]))
 
or
 
Total Consent =
VAR EndConsentdate = MAX('02 | Calendar'[day_date])
VAR StartConsentdate = MIN('02 | Calendar'[day_date])

VAR Result =
    CALCULATE(
            [Number of People with Consent],
            REMOVEFILTERS('02 | Calendar'),
            dev_con_consent[capture_day_date] <= EndConsentdate,
            dev_con_consent[expiration_day_date] > StartConsentdate

        ||
        ISBLANK(dev_con_consent[expiration_day_date])
    )
Return
Result    
 
 

 

1 ACCEPTED SOLUTION

Hi, @Invesco 

 

Try this.

Measure =
VAR EndConsentdate =
    MAX ( '02 | Calendar'[day_date] )
VAR StartConsentdate =
    MIN ( '02 | Calendar'[day_date] )
RETURN
    IF (
        SELECTEDVALUE ( dev_con_consent[capture_day_date] ) <= EndConsentdate
            && SELECTEDVALUE ( dev_con_consent[expiration_day_date] ) > StartConsentdate,
        1,
        0
    )

 

 Best Regards

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @Invesco 

 

You can try the following methods.

Measure =
VAR EndConsentdate =
    MAX ( '02 | Calendar'[day_date] )
VAR StartConsentdate =
    MIN ( '02 | Calendar'[day_date] )
RETURN
    IF (
        dev_con_consent[capture_day_date] <= EndConsentdate
            && dev_con_consent[expiration_day_date] > StartConsentdate,
        1,
        0
    )

Place this measure in the Filter of the matrix view and set it equal to 1. See if the matrix view changes with the date slicer.

 

Best Regards,

Community Support Team _Charlotte

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

 

Getting the following error message

Invesco_0-1663831325557.png

 

Hi, @Invesco 

 

Try this.

Measure =
VAR EndConsentdate =
    MAX ( '02 | Calendar'[day_date] )
VAR StartConsentdate =
    MIN ( '02 | Calendar'[day_date] )
RETURN
    IF (
        SELECTEDVALUE ( dev_con_consent[capture_day_date] ) <= EndConsentdate
            && SELECTEDVALUE ( dev_con_consent[expiration_day_date] ) > StartConsentdate,
        1,
        0
    )

 

 Best Regards

Many Thanks

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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