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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
i820017
Resolver II
Resolver II

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'
 
1 ACCEPTED SOLUTION
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.

 

View solution in original post

4 REPLIES 4
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.

 

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. 

i820017_0-1678113852637.png

 

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.

 

This DAX script worked...thanks!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.