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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dmbd1904
Helper III
Helper III

Blanks as Nulls in Matrix

Hi I'm trying to convert blank values in my matrix to Zero's. The table looks as follows:

 

Forecast = CALCULATE(DISTINCTCOUNT(Task[UniqueTaskID]))

 

dmbd1904_0-1599738943698.png

 

I tried to create another measure as 

Forecast in Period = IF(ISBLANK([Forecast]),0,[Forecast])
but this returns the folowing tables with Rows repeated for some reason - It seems it's take Row names from other projects which have been filtered out.
 
 

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@dmbd1904 

Adding +0 to the end of your measure is one quick way to fix this

 

Forecast = CALCULATE(DISTINCTCOUNT(Task[UniqueTaskID]))+0

 

 

Paul Zheng _ Community Support Team
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

9 REPLIES 9
V-pazhen-msft
Community Support
Community Support

@dmbd1904 

Adding +0 to the end of your measure is one quick way to fix this

 

Forecast = CALCULATE(DISTINCTCOUNT(Task[UniqueTaskID]))+0

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

 

Greg_Deckler
Super User
Super User

@dmbd1904 - Generally that is:

Measure =
  VAR __Calc = <some calculation>
RETURN
  IF(ISBLANK(__Calc),0,__Calc)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler  , i tried that and got the same problem. See the image in my reply (It wouldn't let me include in the original post)

@dmbd1904 - Try

Measure =
  VAR __Calc = <some calculation>
RETURN
  IF(__Calc<0,0,__Calc)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

No unfortunately that didn't work either

@dmbd1904 Can you post sample data as text that replicates this issue so I can mock it up?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
dmbd1904
Helper III
Helper III

SharedScreenshot.jpg

@dmbd1904 , typically this creates a left join and you start getting all values.

 

 

Hi @amitchandak , I'm not sure I understand but is that what's causing the problem? Is there anyway to avoid the problem?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.