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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX not matching for single selected records and matching with select all records

Hi , I have created DAX and the data is about employees 

I created a DAX which is working fine 

If i select the single record in slicer option it is showing wrong data 
If i select all it is showing correct data 
The shown data is taken in Card Visualisation

Thank you in advance

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

I wonder what your dax is like, which is important to solve the problem.

 

Best Regards

Allan

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler 

 

Please find the below Measeures i have used and let mw know why am i getting wrong values

 

ENDINGS = [STARTINGS]+COUNT(OnBoard[Date of joining (MM-DD-YYYY)])-(COUNT(Separation[Exit Date]))
Startings = [Last Period check]+[Last Period Employee]
Last Period Check =
var _min = minx(ALLSELECTED('OnBoard'),('OnBoard'[Date of joining (MM-DD-YYYY)]))

Return
CALCULATE(COUNT('OnBoard'[Date of joining (MM-DD-YYYY)]),filter(ALL('OnBoard'),'OnBoard'[Date of joining (MM-DD-YYYY)]< _min))
Last Period Employee =
var _min_date = minx(all('Calendar'),'Calendar'[Date])
var _Expression=if(ISFILTERED('CALENDAR'[Month Year]),maxx('CALENDAR',ENDOFMONTH(DATEADD('CALENDAR'[Date],-1,MONTH))),maxx('CALENDAR',DATEADD('CALENDAR'[Date],-1,YEAR)))
Return
CALCULATE(COUNTx(FILTER(Separation,Separation[Date of joining]<=_Expression && Separation[Date of joining]>=_min_date && (ISBLANK(Separation[Exit Date]) || Separation[Exit Date]>_Expression)),(Separation[Employee ID])),CROSSFILTER(Separation[Date of joining],'CALENDAR'[Date],None))
 
 Here in the total I have a a total count from Measure Endings and that dax is working fine. and for each individual division it is showing wrong values .Please help on this
DivisionENDINGS
 187
 187
a191
b189
c188
d239
e209
f198
g191
h188
Total284

@Anonymous , Those are reasonably complicated measures. It is going to be difficult to solve this without sample source data posted in text and then a definition of what wrong and right is.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.