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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
keranjit
Regular Visitor

Removing blank option in slicer but including blanks - Also 2 slicers affecting one measure

I have a table full of collections - including if it was late or ontime, who collected, coll ID, date collected, the late reason etc

 

Ideally I want to do a Count of the number of deliveries using 2 slicers - Date and Late reason + Blanks

(This measure will be used to calculating performance per carrier)

 

E.g User can select Month and then select Late reason and must have (Blank) selected at all times

The collection count is then show in a table - split by carrier

 

power bi 2.JPG

power bi 1.JPG

 

The tricky bit is I don't want the user to see the option (Blank) in the slicer.

 

 

I've tried a page filter to remove blanks and add them on in my measure.

 

Coll = COUNTROWS(sheet3) + CALCULATE(COUNTROWS(Sheet3),ALLEXCEPT(Sheet3,Sheet3[Carrier name],Sheet3[Date]),Sheet3[MAIN REASON]="")

 

(The first part counts the lates selected, The second part counts the blanks)

 

When using the date and late reason slicers, the late reasons slicer reduces the date range which in turn affects the second part of the Collection count measure.

 

The easier the solution the better please and I'm still a beginner in using DAX.

 

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@keranjit,

Check if the following DAX returns your expected result.

Coll = CALCULATE(COUNTROWS(Sheet3),FILTER(ALL(Sheet3), Sheet3[MAIN REASON]=BLANK()))+COUNTROWS(Sheet3)

Regards,

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.