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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to use an else if or have a default function in this measure

Sorry for the vague title but it was difficult to word. 

To start off with, on my report I have a slicer and a card. As shown below:

KyleAdam_1-1630896053678.png

 

 

As you can see the Card is currently blank, which is a problem. This is because I have a measure in the card that only shows up when a Deal is selected on the slicer. 

This is the measure below, that a kind user on here gave me:

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())
 
This works perfectly fine for the Deal slicer by the way, the maths isn't an issue. However, when a Deal isn't selected, I want the card to just display [PO Billed]. I've been trying for hours on implementing this but I've had no luck. I've tried ELSE statements and they don't work. How would I be able to accomplish this? 
1 ACCEPTED SOLUTION
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 )
) , _POBilled )
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
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 )
) , _POBilled )
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.