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
sleekpeek
Regular Visitor

Count Blank Values with Others in Measure

I have the query below. For segment, I need to count 2 values (value 1 and value 2) plus any blank values into the query.   Can I do this?
 
[i've amended the table and field values below to generic ones]
 
CALCULATE(SUM(Opp[ARR]), FILTER(Opp, Opp[StageName] IN { "3", "4}), FILTER(Account, Account[Segment] IN { "value1", "value2"}),USERELATIONSHIP(date[Date])) etc
 
Thanks
6 REPLIES 6
smpa01
Super User
Super User

@sleekpeek  Can you try the following

 

CALCULATE(SUM(Opp[ARR]), FILTER(Opp, Opp[StageName] IN { "3", "4}), FILTER(Account, Account[Segment] IN { "value1", "value2", BLANK()}),USERELATIONSHIP(date[Date]))

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
amitchandak
Super User
Super User

@sleekpeek , try like

 

CALCULATE(SUM(Opp[ARR]), FILTER(Opp, Opp[StageName] IN { "3", "4}), FILTER(Account, ( Account[Segment] IN { "value1", "value2"}  || isblank(Account[Segment])   ) ),USERELATIONSHIP(date[Date]))

sleekpeek_0-1632756715162.png

I tried, and get this error

when I add in BLANK() the query accepts it, however the values do not change and i'm missing a considerable amount 🙂 I've checked my visual, page and all pages filters and i'm not filtering anywhere to exclude these blanks.

 

when exporting, it looks like this:

sleekpeek_1-1632758802485.png

The segment field references the field to the left ... should I add something to the segment field instead?

 

sleekpeek_0-1632758646840.png

any other suggestions guys .. thanks so far

@sleekpeek  is there any way you can provide a minimum reproducible example of your issue?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

thanks for the suggestion, I don't think I can.  My issue stems from the owner_segment field not (a) having the values we need for a high level segment and (b) not being mandatory hence the blank fields.  The regional segment is a data group field bucketing lots of values from the owner_segment field into 3 values only, however you cannot bucket "blank" I believe.  I think my solution is to ensure that sales ops complete that field on all sales user profiles in the data source.

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.