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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Replace blank value with 0

Hi,

I did a distinct count on session ID in my logfiles.
Where there were no sessions Power BI provides a blank instead of a 0. 

I used "Sessie ID met 0 = DISTINCTCOUNT('logfile'[Sessie ID]) + 0" to replace the blank with a 0.
Unfortunately this gives me zeros from Jan 2017 until Dec 2019 while I only have logfiles loaded from Aug 2017 until Jun 2019.

Of course it has something to do with my autocalender I created (see below).

Any ideas on it?


Datum =
VAR MinYear = YEAR ( MIN ( 'logfile'[Tijd] ) )
VAR MaxYear = YEAR ( MAX ( 'logfile'[Tijd] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( );
AND ( YEAR ( [Date] ) >= MinYear; YEAR ( [Date] ) <= MaxYear )
);

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi HansK, 

Which visual did you use  in report? If you use Matrix, you could refer to this similar post(Display zero instead of blank in matrix) for more details. If you ue Table, you could try to use ramsyBI's suggestions, which should work.

Best Regards,
Zoe Zhi

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
dax
Community Support
Community Support

Hi HansK, 

Which visual did you use  in report? If you use Matrix, you could refer to this similar post(Display zero instead of blank in matrix) for more details. If you ue Table, you could try to use ramsyBI's suggestions, which should work.

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

You can use Isblank funtion:

 

Measure = if(ISBLANK([OrigMeasure]),0,[OrigMeasure])

 

"Sessie ID met 0= if(ISBLANK(DISTINCTCOUNT('logfile'[Sessie ID]),0,DISTINCTCOUNT('logfile'[Sessie ID]))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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