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

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

Reply
arifulice09
Helper I
Helper I

need to showing 0 when there is no value in data table

I have three table , two is dimension( DimUser, DimWeek)  and one is fact table(JC), I have created a simple measure( count(JC[userWeek])  for counting attendance per week , it is returning result ok, some user are not coming in entire week ( for user Eric Kinzer he not coming week 24 and 25 ) , I need to show 0 on that week. Please see the attached.pblm.PNG

4 REPLIES 4
Migasuke
Memorable Member
Memorable Member

Hi @arifulice09 ,
You can achieve that with IF statement.
Basiaclly you want to say something like this - if I receive blank result, replace it with zero.

Measure would look like this:
MyMeasure =
var _CountUsers = COUNT(JC[userWeek]) 

return
IF(ISBLANK(_CountUsers),0,_CountUsers))



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Thanks for your reply, when I am using your measure then those user are showing in matrix who are not coming in a single day in entire month, in this case no need to showing in matrix, user like  "Erica Mckenzie"  , who not coming in a single day in entire month please see tha ttached.pblm2.PNG

Anonymous
Not applicable

Hi @arifulice09 ,

 

My Sample is as below.

JC:

RicoZhou_1-1659410808185.png

DimWeek:

RicoZhou_2-1659410814572.png

DimUser:

RicoZhou_3-1659410820969.png

Please try this code to create a measure.

Attendance Per Week = 
VAR _SUMMARIZE =
    SUMMARIZE (
        ALL ( DimUser ),
        DimUser[User],
        "Count", CALCULATE ( COUNT ( JC[userWeek] ), ALL ( DimWeek ) )
    )
RETURN
    IF (
        COUNTAX ( FILTER ( _SUMMARIZE, [User] = MAX ( DimUser[User] ) ), [Count] )
            = BLANK (),
        BLANK (),
        COUNT ( JC[userWeek] ) + 0
    )

Result is as below.

RicoZhou_0-1659410753147.png

 

Best Regards,
Rico Zhou

 

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

Thanks for your kind reply, I  have already solved it using the help of ALL function 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.