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
MarkMellink
Frequent Visitor

KPI Visuals and (Blank) - Issue with making (Blank) a 0

 

blank2.PNG

The measure that is being displayed in the KPI is a monthly average of several of the DISTINCTCOUNT measures displayed on the right. If it can't find any occurrences it returns (Blank), resulting in the KPI picture at the top.

 

I know this is a common problem and that people solve it by either doing the following:

[Measure] + 0

or

IF(ISBLANK([Measure]),0,[Measure])

I've tried both of these solutions. This works for 0 values, but for some reason, they change my measure to 0 always, even if there are values to be counted.

 

See this example below:

 

Before change:

blank3.PNG

After change:

blank4.PNG

 

This is the measure in question, the change is highlighted in bold at the end of the code:

Active Internal Users = CALCULATE(DISTINCTCOUNT(PlatformEvents[UserId]), PlatformEvents[CountEvents] > 0) + 0

 The average in the KPI is calculated as follows:

Average Active Internal Users Last Month = ([Active Internal Users] +
     CALCULATE([Active Internal Users],DATEADD(TimeDimension[Date],-7,,DAY)) +
     CALCULATE([Active Internal Users],DATEADD(TimeDimension[Date],-14,,DAY)) +
     CALCULATE([Active Internal Users],DATEADD(TimeDimension[Date],-21,,DAY)))/4

Note the extra commas (,,) after numbers in the above DAX code. For some reason whenever I add numbers I need to add an extra comma otherwise it doesn't see it as a proper comma for the next argument. This might have something to do with my problem?

 

I was wondering if anyone ever had this problem before? It's quite frustrating and could easily be solved if I had the option in this idea thread.

 

Any help would be appreciated!

5 REPLIES 5
Anonymous
Not applicable

Hi.

It is because, in addition to not wanting empty, the KPI visual works ONLY on the CUMULATED measures! 

I spent the whole day to figure it out.

 

Hope it helps.

MarkMellink
Frequent Visitor

Great thanks, very interested to find out what the cause of this is!

MarkMellink
Frequent Visitor

Yes here is some sample data with the (Blank) occurrence (the app example in my OP):

 

https://ufile.io/5lz3u

 

Here is sample data without the (Blank) occurrences (the user example in my OP), but that can be used to test 0 problem once you add +0 to the formula:

 

https://ufile.io/41nve

 

They're .csv files. If you would prefer something else let me know!

OK, I have the files, CSV's are good. I'll take a look at it.


@ 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...
Greg_Deckler
Super User
Super User

Can you share some made-up or sample data? I'd like to experiment with this.


@ 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...

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.