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
pjakka
Regular Visitor

How to pass measure in 'IN DAX' of Power BI

Hello Experts,

 

I have one power bi report where I have two slicers (lists) and 1 clustered column chart. I want show the selected categories(Multiple selected) from the both the slicers in the single clustered column chart.

 

I have created fist DAX which gives me multiple selected options from the slicer(list)

 

MultiSelect =
IF (
    ISFILTERED ( SiteCaseLoadComparison1[SiteCaseloadName] ),
    CONCATENATEX (
        ALLSELECTED ( SiteCaseLoadComparison1[SiteCaseloadName] ),
        SiteCaseLoadComparison1[SiteCaseloadName],
        ","
    ),
    "(All)"
)

 

 

I have created second DAX in which I am passing the first measure named 'MultiSelect' within IN function

 

FamilyCount_combined =
CALCULATE (
    COUNT ( V_Comibined_Survey_Response[cra04_familyid] ),
    FILTER (
        V_Comibined_Survey_Response,
        V_Comibined_Survey_Response[cra04_sitecaseloadname]
            IN {
                SELECTEDVALUE ( StateComparison1[State] ),
                [MultiSelect]
            }
    )
)

 

 but somehow this Measure is not giving the family count across multiselected categories from slicer.

 

can anyone help me with solving this?

 

any quick help is really appriciable.

 

Best Regards,

Pranesh

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

Hi, @pjakka 

 

I agree with the above reply, but one more condition is needed.

FamilyCount_combined =
CALCULATE (
    COUNT ( V_Comibined_Survey_Response[cra04_familyid] ),
    FILTER (
        V_Comibined_Survey_Response,
        V_Comibined_Survey_Response[cra04_sitecaseloadname]
            IN VALUES ( SiteCaseLoadComparison1[SiteCaseloadName] )
                || V_Comibined_Survey_Response[cra04_sitecaseloadname]
                    = SELECTEDVALUE ( StateComparison1[State] )// IN VALUES ( StateComparison1[State] )
    )
)

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,
Community Support Team _ Janey

 

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @pjakka 

 

I agree with the above reply, but one more condition is needed.

FamilyCount_combined =
CALCULATE (
    COUNT ( V_Comibined_Survey_Response[cra04_familyid] ),
    FILTER (
        V_Comibined_Survey_Response,
        V_Comibined_Survey_Response[cra04_sitecaseloadname]
            IN VALUES ( SiteCaseLoadComparison1[SiteCaseloadName] )
                || V_Comibined_Survey_Response[cra04_sitecaseloadname]
                    = SELECTEDVALUE ( StateComparison1[State] )// IN VALUES ( StateComparison1[State] )
    )
)

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,
Community Support Team _ Janey

 

TomMartens
Super User
Super User

Hey @pjakka ,

 

the IN operator expects a table, but the measure MultiSelect returns a String.

Maybe this will already to the trick:

 

FamilyCount_combined =
CALCULATE (
    COUNT ( V_Comibined_Survey_Response[cra04_familyid] ),
    FILTER (
        V_Comibined_Survey_Response,
        V_Comibined_Survey_Response[cra04_sitecaseloadname]
            IN 
                VALUES ( SiteCaseLoadComparison1[SiteCaseloadName] )
            
    )
)

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.

Top Solution Authors
Top Kudoed Authors