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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Invesco
Helper V
Helper V

Additional Filter to TRICKY DAX

Hi Experts

 

How would i apply an addtional filter to the following DAX

Measure =
  VAR __Table = FILTER('eda_edetailing_slides_used', [drmf_clm_presentation_slide_id] <> BLANK())
  VAR __Column1 = SELECTCOLUMNS(__Table,"__Column",[crm_call_name])
  VAR __Column2 = SELECTCOLUMNS(__Table,"__Column",[crmf_hcp_id])
RETURN
  COUNTROWS(DISTINCT(UNION(__Column1, __Column2)))

 Filter

eda_edetailing_slides_used[activity_type_1] IN {"f2f", "Virtual"}))

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

MyMeasure =
VAR __Table =
    FILTER (
        'eda_edetailing_slides_used',
        NOT ( ISBLANK ( [drmf_clm_presentation_slide_id] ) )
            && eda_edetailing_slides_used[activity_type_1] IN { "f2f", "Virtual" }
    )
VAR __Column1 =
    SELECTCOLUMNS ( __Table, "__Column", [crm_call_name] )
VAR __Column2 =
    SELECTCOLUMNS ( __Table, "__Column", [crmf_hcp_id] )
RETURN
    COUNTROWS ( DISTINCT ( UNION ( __Column1, __Column2 ) ) )

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

MyMeasure =
VAR __Table =
    FILTER (
        'eda_edetailing_slides_used',
        NOT ( ISBLANK ( [drmf_clm_presentation_slide_id] ) )
            && eda_edetailing_slides_used[activity_type_1] IN { "f2f", "Virtual" }
    )
VAR __Column1 =
    SELECTCOLUMNS ( __Table, "__Column", [crm_call_name] )
VAR __Column2 =
    SELECTCOLUMNS ( __Table, "__Column", [crmf_hcp_id] )
RETURN
    COUNTROWS ( DISTINCT ( UNION ( __Column1, __Column2 ) ) )

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.