cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Riddell19831
Regular Visitor

HELP

I have a measure below but I dont want to calculate blanks as 0 

 

HTPTS = IF ( 'BSCA Attendance'[HT1] = 0, 100, 0 ) + IF('BSCA Attendance'[HT2]=0,100,0) + IF('BSCA Attendance'[HT3]=0,100,0) + IF('BSCA Attendance'[HT4]=0,100,0) + IF('BSCA Attendance'[HT5]=0,100,0) + IF('BSCA Attendance'[HT6]=0,100,0)
 
its calculating the blanks and giving the value of 100 for each blank so 600 in total if all 0 or blank
 
Any ideas how to fix this 
1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Riddell19831 ,

 

According to your description, for row is blank(), its default type is Text and cannot be judged directly, you need to use the isblank function. I made a modification, the reference is as follows:

 

c = 
IF ( 'BSCA Attendance'[HT1] = 0, 100, 0 )
    + IF ( 'BSCA Attendance'[HT2] = 0, 100, 0 )
    + IF ( ISBLANK ( 'BSCA Attendance'[HT3] ), 100, 0 )
    + IF ( 'BSCA Attendance'[HT4] = 0, 100, 0 )
    + IF ( 'BSCA Attendance'[HT5] = 0, 100, 0 )
    + IF ( ISBLANK ( 'BSCA Attendance'[HT6] ), 100, 0 )

 

vhenrykmstf_0-1630484688210.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Riddell19831 ,

 

According to your description, for row is blank(), its default type is Text and cannot be judged directly, you need to use the isblank function. I made a modification, the reference is as follows:

 

c = 
IF ( 'BSCA Attendance'[HT1] = 0, 100, 0 )
    + IF ( 'BSCA Attendance'[HT2] = 0, 100, 0 )
    + IF ( ISBLANK ( 'BSCA Attendance'[HT3] ), 100, 0 )
    + IF ( 'BSCA Attendance'[HT4] = 0, 100, 0 )
    + IF ( 'BSCA Attendance'[HT5] = 0, 100, 0 )
    + IF ( ISBLANK ( 'BSCA Attendance'[HT6] ), 100, 0 )

 

vhenrykmstf_0-1630484688210.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Fowmy
Super User
Super User

@Riddell19831 

Add the following code as a new column to get the desired results.

HTPTS = 
COUNTROWS(
    FILTER(
        { 'BSCA Attendance'[HT1] ,'BSCA Attendance'[HT2] , 'BSCA Attendance'[HT3], 'BSCA Attendance'[HT4], 'BSCA Attendance'[HT5], 'BSCA Attendance'[HT6] },
        NOT ([Value] == BLANK()) && [Value]=0 
    )
) * 100
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI Show Ep 4 Post Show Carousel.jpg

The Power BI Community Show

Shabnam Watson demos Incremental refresh & Hybrid Tables and Leila Etaati demos Charticulator.

PBI April Release 2022 768x460.png

Check it out!

Click here to read more about the April 2022 updates!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!