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

Measure ignores slicer and causes return of extra rows.

I am trying to do this:

Live SKUs =
VAR LiveSKUs = COUNTROWS(FILTER(PIM, or(PIM[Status]="20",PIM[Status]="50"))) / COUNT(PIM[Status])
RETURN LiveSKUs

Some rows return a blank value, I would like instead it to return 0.

I attempted returning IF(ISBLANK(LiveSKUs),0,LiveSKUs) in the DAX but this led to rows outside the slicer filter to be returned.

How can I successuly produce the desired result whilst adhereing to the slicer?

TIA

1 ACCEPTED SOLUTION

Hi  ,
Thanks for reaching out to the Microsoft fabric community forum. 

Please try to use this
Live SKUs :=
VAR FilteredTable =
FILTER(
PIM,
PIM[Status] IN { "20", "50" }
)
VAR LiveSKUsCount =
CALCULATE(COUNTROWS(FilteredTable))
VAR TotalCount =
COUNT(PIM[Status])
RETURN
IF(
ISBLANK(TotalCount),
0,
DIVIDE(LiveSKUsCount, TotalCount, 0)
)

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Menaka.
Community Support Team  

 

View solution in original post

7 REPLIES 7
sjoerdvn
Super User
Super User

try this

IF(ISBLANK(COUNT(PIM[Status])),BLANK(),
  COUNTROWS(FILTER(PIM, or(PIM[Status]="20",PIM[Status]="50"))) / COUNT(PIM[Status])
)
v-menakakota
Community Support
Community Support

Hi @JACK__ ,

Thanks for reaching out to the Microsoft fabric community forum. 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster. 

Best Regards, 
Menaka.
Community Support Team  

Hi  @JACK__ ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily. 

 
Best Regards, 
Menaka.
Community Support Team  

Hi @JACK__ ,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help. If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution. 
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you. 
Thank you for your patience and look forward to hearing from you. 

bhanu_gautam
Super User
Super User

@JACK__ , Try using

DAX
Live SKUs =
VAR LiveSKUsCount = COUNTROWS(FILTER(PIM, PIM[Status] = "20" || PIM[Status] = "50"))
VAR TotalCount = COUNT(PIM[Status])
VAR LiveSKUs = DIVIDE(LiveSKUsCount, TotalCount, 0)
RETURN LiveSKUs




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






This didn't do it 

Hi  ,
Thanks for reaching out to the Microsoft fabric community forum. 

Please try to use this
Live SKUs :=
VAR FilteredTable =
FILTER(
PIM,
PIM[Status] IN { "20", "50" }
)
VAR LiveSKUsCount =
CALCULATE(COUNTROWS(FilteredTable))
VAR TotalCount =
COUNT(PIM[Status])
RETURN
IF(
ISBLANK(TotalCount),
0,
DIVIDE(LiveSKUsCount, TotalCount, 0)
)

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Menaka.
Community Support Team  

 

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.