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
Anonymous
Not applicable

How to make a sumx measure only filter when a slicer is selected?

Hello there, I have a measure that only provides one of two sums in a specific Deal, here it is below: 

DealPO =
SUMX (
VALUES ( 'Deals (CRM)'[Deal Name] ),
VAR _POTotal = [VO PO Total]
VAR _POBilled = [PO Billed]
RETURN
IF ( ISBLANK ( _POTotal ), _POBilled, _POTotal )
)
 
To put it short, this measure will choose which Sum is needed on a specific Deal, it works fine. However, I only want this measure to operate as soon as a user interacts with the [Deal Name] slicer below:

KyleAdam_0-1630522302713.png
 
Is there any way the DealPO measure can be altered so that it only works when the slicer above has been selected? I have tried implementing an IF ISFILTERED but it doesn't work but I'm not sure I'm doing it correctly. Any help would be appreciated. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello @v-yiruan-msft I did actually manage to find a solution just recently, thanks to Amit in another thread. 

Here is the measure below that is used:


DealPO =
VAR _POTotal = [VO PO Total]
VAR _POBilled = [PO Billed]
RETURN
if( isfiltered('Deals (CRM)'[Deal Name]) ,
SUMX (
VALUES ( 'Deals (CRM)'[Deal Name] ),
IF ( ISBLANK ( _POTotal ), _POBilled, _POTotal )
) , _POBilled )

so now it will show a default [PO Billed] when a Deal isn't selected, rather than stay blank if a Deal isn't selected. That was the issue I had afterwards. Thank you guys. 


View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try like

 

DealPO =
VAR _POTotal = [VO PO Total]
VAR _POBilled = [PO Billed]
RETURN
if( isfiltered('Deals (CRM)'[Deal Name]) ,
SUMX (
VALUES ( 'Deals (CRM)'[Deal Name] ),
IF ( ISBLANK ( _POTotal ), _POBilled, _POTotal )
) , blank())

Anonymous
Not applicable

Hi @amitchandak 

I'm not sure why but that's showing up a blank value on my card for [PO Billed] when a Deal isn't selected. 

Why do you think that is?

Hi @Anonymous ,

Do you want to implement the DealPO value to be displayed only when the Deal Name slicer has the options selected. If the slicer doesn't have any value selected, it won't be displayed. Do I understand correctly? If not, could you please explain the result you want with specific sample and relevant screenshots. Thank you.

yingyinr_0-1631095528877.png

In addition, could you share with us the formulas for the two measures [VO PO Total] and [PO Billed] and the sample data of the table involved in the visual in order to provide you with a suitable solution? Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello @v-yiruan-msft I did actually manage to find a solution just recently, thanks to Amit in another thread. 

Here is the measure below that is used:


DealPO =
VAR _POTotal = [VO PO Total]
VAR _POBilled = [PO Billed]
RETURN
if( isfiltered('Deals (CRM)'[Deal Name]) ,
SUMX (
VALUES ( 'Deals (CRM)'[Deal Name] ),
IF ( ISBLANK ( _POTotal ), _POBilled, _POTotal )
) , _POBilled )

so now it will show a default [PO Billed] when a Deal isn't selected, rather than stay blank if a Deal isn't selected. That was the issue I had afterwards. Thank you guys. 


Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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