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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Invesco
Helper V
Helper V

DAX Measure Error - if Nothing is selected in Slicers

Hi Experts

 

Getting blank() error in my card visual if nothing is selected in either teh Region and or Area Slicer how can i amend the measure to return back total result

measure

Accounts Reached =
VAR _Overall =  DIVIDE([Shingrix],[Practices],0)
VAR _Step1 = CALCULATE(DISTINCTCOUNT('dev_shc_shingrix_activity'[P Name]),
    FILTER(ALLSELECTED('dev_shc_shingrix_activity'),'dev_shc_shingrix_activity'[Region]=MAX('dev_shc_shingrix_activity'[Region]) &&
        'dev_shc_shingrix_activity'[Area]=MAX('dev_shc_shingrix_activity'[Area]) &&
        'dev_shc_shingrix_activity'[product_name] ="Shingrix"))
Return
    IF(_Step1=BLANK(),_Overall,_Step1)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Invesco ,

You can also try the following dax:

Accounts Reached =
VAR _Overall =  DIVIDE([Shingrix],[Practices],0)
VAR _Step1 = CALCULATE(DISTINCTCOUNT('dev_shc_shingrix_activity'[P Name]), FILTER(ALLSELECTED('dev_shc_shingrix_activity'),'dev_shc_shingrix_activity'[Region]=MAX('dev_shc_shingrix_activity'[Region]) &&
        'dev_shc_shingrix_activity'[Area]=MAX('dev_shc_shingrix_activity'[Area]) &&
        'dev_shc_shingrix_activity'[product_name] ="Shingrix"))
Return
IF(    HASONEVALUE('dev_shc_shingrix_activity'[Region])&&HASONEVALUE('dev_shc_shingrix_activity'[Area]),
_Step1, _Overall)

 

Best Regards,

Liu Yang

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
Anonymous
Not applicable

Hi  @Invesco ,

You can also try the following dax:

Accounts Reached =
VAR _Overall =  DIVIDE([Shingrix],[Practices],0)
VAR _Step1 = CALCULATE(DISTINCTCOUNT('dev_shc_shingrix_activity'[P Name]), FILTER(ALLSELECTED('dev_shc_shingrix_activity'),'dev_shc_shingrix_activity'[Region]=MAX('dev_shc_shingrix_activity'[Region]) &&
        'dev_shc_shingrix_activity'[Area]=MAX('dev_shc_shingrix_activity'[Area]) &&
        'dev_shc_shingrix_activity'[product_name] ="Shingrix"))
Return
IF(    HASONEVALUE('dev_shc_shingrix_activity'[Region])&&HASONEVALUE('dev_shc_shingrix_activity'[Area]),
_Step1, _Overall)

 

Best Regards,

Liu Yang

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

NikhilChenna
Skilled Sharer
Skilled Sharer

Hi @Invesco ,

I think you are getting blank because of max & all selected function, 

 

Accounts Reached =
CALCULATE(DISTINCTCOUNT('dev_shc_shingrix_activity'[P Name]),
    FILTER('dev_shc_shingrix_activity'[product_name] ="Shingrix"))
 
Just try this out.
 
Regards,
Nikhil Chenna
 
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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
Top Kudoed Authors