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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Analitika
Post Prodigy
Post Prodigy

Null value in Power BI using measure

Hello,

 

Having issue with sales comparing this year last year in percentage. I created a measure but getting null values somehow.

 

 

mok_ly = 
IF( HASONEVALUE('Date'[Metai]) ,CALCULATE ( [moketina_suma],
    DATEADD ('Date'[Date],-1,YEAR ) ) )​

 

 

Analitika_0-1656492307513.png

How to resolve this issue?
3 REPLIES 3
Anonymous
Not applicable

Hi @Analitika ,

 

You may modify your measure as 

mok_ly = 
IF( HASONEVALUE('Date'[Metai]) ,1,0 )​

Then put it in your visual and see if it returns 1 or 0.

And also add a measure as folllows into the visual to check if it returns the results.

CALCULATE ( [moketina_suma],
    DATEADD ('Date'[Date],-1,YEAR ) )

 

The above two actions might help you see which part is going wrong.

 

 

Best Regards,

Stephen Tao

 

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

selimovd
Super User
Super User

Hey @Analitika ,

 

did you mark you date table as date table?

Otherwise you have to add an ALL('Date') to the CALCULATE.

 

Did you check if HASONEVALUE('Date'[Metai]) is true? So if the CALCULATE will be executed?

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Yes,

 

Date table is used in that measure. Date[Metai] means Date[Year], I see is true 

Analitika_0-1656494181201.png

Metai is one value.

@selimovd 

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.

Top Solution Authors