Forum Discussion

i820017's avatar
i820017
Icon for Resolver II rankResolver II
3 years ago
Solved

Measure with Filter Question

I have 2 measures as seen below.

% Of Completion = DIVIDE(SUM('ops vw_SurveyDetails'[Survey Completion]), [Survey_Count])
% of Completion w/out = CALCULATE(DIVIDE(SUM('ops vw_SurveyDetails'[Survey Completion]), [Survey_Count]),
'ops vw_SurveyDetails'[Event_Status_Survey_Not_Offered] = 1)
 
I have a custom column called 'ops vw_SurveyDetails'[Event_Status_Survey_Not_Offered] = 1
 
I have a column called 'MediaType' that has 'Call' or 'Chat' in it.
 
I am trying to set up a measure that uses % of Completion measure when 'Media Type' = 'Call' or 'Chat'
and that uses % of Completion w/out when 'Media Type' = 'Chat'
 
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi i820017 

    Can you offer the sample data you have descibed, based on the information you have offered, you can refer to the following example

    Type_Measure =
    VAR _values1={"Survey Completed", "Survey not Completed","Survey not Offered"}
    VAR _values2={"Survey Completed", "Survey not Completed"}
    SWITCH (
        TRUE (),
        SELECTEDVALUE('ops vw_SurveyDetails'[MediaType] ) = "Chat", CALCULATE([% Of Completion],'ops vw_SurveyDetails'[EventStatus] IN  _values2),SELECTEDVALUE('ops vw_SurveyDetails'[MediaType] ) = "Call", CALCULATE([% Of Completion],'ops vw_SurveyDetails'[EventStatus] IN  _values1),[% Of Completion])

    Best Regards!

    Yolo Zhu

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

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi i820017 

    You can refer to the following measure

    Type_Measure =
    SWITCH (
        TRUE (),
        OR (
            MAX ( 'ops vw_SurveyDetails'[MediaType] ) = "Call",
            AND (
                CONTAINSSTRING ( MAX ( 'ops vw_SurveyDetails'[MediaType] ), "Chat" ),
                CONTAINSSTRING ( MAX ( 'ops vw_SurveyDetails'[MediaType] ), "Call" )
            )
        ), [% Of Completion],
        MAX ( [MediaType] ) = "Chat", [% of Completion w/out]
    )

     

    Best Regards!

    Yolo Zhu

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

     

    • i820017's avatar
      i820017
      Icon for Resolver II rankResolver II

      This dax measure doesn't yield the results that I need it to yield.

       

      I apolgize for being unclear, but I want to create a measure called '%_of_Completion' = DIVIDE(SUM('ops vw_SurveyDetails'[Survey Completion]), [Survey_Count])

      Then, when I click on the 'MediaType' slicer for 'Call' then all columns under 'EventStatus' should show up (in the DAX measure). The columns under 'EventStatus' are 'Survey Completed', 'Survey not Completed', and 'Survey not Offered').

      When I click on the 'MediaType' slicer for 'Chat' then only certain columns under 'EventStatus' should show up (in the Dax measure). The columns that should show up are 'Survey Completed' and 'Survey not Completed'.

      When neither 'Call' nor 'Chat' are selected, then all columns under 'EventStatus' should show up (in the DAX measure).

       

      I am using the DAX measure to create a line graph as seen below. 

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi i820017 

        Can you offer the sample data you have descibed, based on the information you have offered, you can refer to the following example

        Type_Measure =
        VAR _values1={"Survey Completed", "Survey not Completed","Survey not Offered"}
        VAR _values2={"Survey Completed", "Survey not Completed"}
        SWITCH (
            TRUE (),
            SELECTEDVALUE('ops vw_SurveyDetails'[MediaType] ) = "Chat", CALCULATE([% Of Completion],'ops vw_SurveyDetails'[EventStatus] IN  _values2),SELECTEDVALUE('ops vw_SurveyDetails'[MediaType] ) = "Call", CALCULATE([% Of Completion],'ops vw_SurveyDetails'[EventStatus] IN  _values1),[% Of Completion])

        Best Regards!

        Yolo Zhu

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