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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
prady2581
Helper I
Helper I

Allselected not considering the date filter context

I use below dax code to calculate % of client survyes to the total survey count received. 

% Contribution of clients =
DIVIDE(
COUNT(
'Raw data'[clientname]),[Client_count_All])
Client_count_All is a measure =  
CALCULATE(
COUNT('Raw data'[clientname]),ALLSELECTED('Raw data')
)
 
When a table matrix visual , i put the client name and total surveys then % Contribution of clients and 1 date slicer it gives the correct figures. the moment i add month year as column in the table matrix it is not giving the correct figures. i think it is adds up the total for jul'22 and aug'22 and then it takes this amount as total count 
 
I want this measure to accept all context from slicers or and on table matrix ( in table matrix row will be always client name and column will be either month, or quarter from the date dim table). please provide some guidance on how to fix this. 
 
 this is correct 
date slicer      
01-07-202231-Jan-23 clienttotal surveystotal count% contribution
   a4520002%
   b3020002%
   1420001%
   d320000%
   5620003%
    9820005%
   total2000 100%

 

this is not correct

date slicer  total surveys% contribution    
01-07-202231-Jan-23clientJul-22total count%Jul-22total count%
  a4512004%3412003%
  b3012003%6712006%
  1412001%2312002%
  d312000%3712003%
  5612005%4412004%
   9812008%3912003%
  total 1200    
1 REPLY 1
amitchandak
Super User
Super User

@prady2581 , In that case you should use remove filters of client

 

Client_count_All =
CALCULATE(
COUNT('Raw data'[clientname]),removefilters('Raw data'[client] )
)

 

Learn Power BI: All, allselected, removefilters,allexcept- https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.