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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sdm2211
Frequent Visitor

Filter not giving correct result.

Dear All,

I am trying to fetch the result of number of times batsman dismissed as per below table

BatsmanNon-StrikerBatsman_RunsWicket_TypePlayer_Dismissed
JE RootBA Stokes1caughtJE Root
JE RootBA Stokes2caughtJE Root
JE RootBA Stokes4bowledJE Root
BA StokesJE Root2run outJE Root
HC BrookJE Root1bowledHC Brook
HC BrookBA Stokes6run outBA Stokes
HC BrookOJ Pope3caughtHC Brook

 

here the concentration should be on column "Player_Dismissed" and It should show the count of no. of dismissed should be as follows;

JE Root - 4

HC Brook - 2 times

BA Stokes - 1 time.

 

However I am getting a following result with the DAX formula used. so basically it is counting only column "Batsman" I knw it is faulty DAX formula. Could anyone please help me to rectify the DAX.

sdm2211_1-1738150913717.png

I am attaching the sample PBIX file.

https://drive.google.com/file/d/1uWqn2PR5WEQU2Dfz73AfG03KURkkmD_u/view?usp=drive_link 

 

Regards,

Sandeep 

 

 

 

1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

@sdm2211 - Use the below:

 

Out = 
VAR _name =
    SELECTEDVALUE ( TEST[Batsman] )
RETURN
    CALCULATE ( COUNTROWS ( TEST ), TEST[Player_Dismissed] = _name, ALL ( TEST ) )

 

See attached for results. 

 

If this works, please accept as the solution to help others with the same challenge. 

View solution in original post

1 REPLY 1
mark_endicott
Super User
Super User

@sdm2211 - Use the below:

 

Out = 
VAR _name =
    SELECTEDVALUE ( TEST[Batsman] )
RETURN
    CALCULATE ( COUNTROWS ( TEST ), TEST[Player_Dismissed] = _name, ALL ( TEST ) )

 

See attached for results. 

 

If this works, please accept as the solution to help others with the same challenge. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.