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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

Count as 1 when there is no value

Please find Pbix file in this location.

I am trying to come up with distinct value as 1 when there is no value with certain criteria.

 

So, bascially, as illustrated as below, I am trying to create a case as one other exception when 

there is no Step = 2 at all.

Bottom illustration shows that there is a case when Step = 1.

JustinDoh1_0-1628875937332.png

What I am trying to do is create as 1 other exception count when there is no Step = 2 at all.

 

Bottom is DAX code that I have been trying to add the condition.

How do I express in DAX ( If value (Step = 2) you are looking for is blank, please count as 1)? 

Logically, it would be like:

-----------------------------------------------

If (Select * from Table where Step = 2) Is NULL
        THEN

 count as 1

----------------------------------------------

Measure =
var Exception = CALCULATE (
                                DISTINCTCOUNT( Table[ClientID] ),
                                (
                               (ISBLANK(Table[ImmunizationDate]) && NOT(Table[Consent] in {"Refused"}) )
                               ||
                              ( ISBLANK(Table[ImmunizationDate]) && (Table[Step] in {2}) )
                              )
                           )
          RETURN
 
IF ( 
        ISBLANK (selectedvalue (Table[Step] ), 2 ),
        1, 
        Exception
)          
            
or something like this?
IF (
         ISBLANK(Table[Step] = 2),
         1,
         Exception
)

                            
                         
2 REPLIES 2
amitchandak
Super User
Super User

@JustinDoh1 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

@amitchandak  Thank you for following up on this issue. Please find my Pbix file (after removing sensitive data). This the Measure that I was working on. Thanks!

JustinDoh1_0-1629134042014.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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