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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nikitun
Frequent Visitor

Using numeric literal constant in Power BI DAX formulas

Hi! I am new to DAX and Power Bi. I have a problem with measure when I use literal numerical constants like #3 in figure below. Calculation is correct, but column is filled for dates not existing in data table. Same problem when measure consists in one number (#4). I guess that the problem somewhere in context, but cant find a desicion. How can I correctly do this calculation in DAX? Thanks!

power rangers.png2.png

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

the problem is with measures #3 and #4

 

for #3 you have

1-DIVIDE(A,B+C+D,0)

which evalueates to 1-0 =1 when B+C+D are = 0 (basically a constant regardless of A,B,C,D)

you need to do it like this:

DIVIDE(B+C+D-A,B+C+D,BLANK())

which evaluates to BLANK() for B+C+D=0 

 

now for #4 I assume you only want to show 1 whenever there is data, so I would do something like this:

IF(ISBLANK([reaches_ratio]),BLANK(),1)

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

1 REPLY 1
Stachu
Community Champion
Community Champion

the problem is with measures #3 and #4

 

for #3 you have

1-DIVIDE(A,B+C+D,0)

which evalueates to 1-0 =1 when B+C+D are = 0 (basically a constant regardless of A,B,C,D)

you need to do it like this:

DIVIDE(B+C+D-A,B+C+D,BLANK())

which evaluates to BLANK() for B+C+D=0 

 

now for #4 I assume you only want to show 1 whenever there is data, so I would do something like this:

IF(ISBLANK([reaches_ratio]),BLANK(),1)

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.