Forum Discussion
count data mismatching in Table Chart
I am getting some wrong count in the chart table. Example, i have given the below.
sample Test File and data Link : https://1drv.ms/u/s!AiSRcgO5FUmN8USBS75RKolqBQDT?e=HBxCu6
What is the problem.?
- Anonymous5 years ago
Hi saivina2920 ,
Please update the formula of measure [TempBalCount] as below and check whether it can get your expected result.... You can find the attachment for the details.
TempBalCount =VAR _selreldate =SELECTEDVALUE ( EMP_TABLE[EMP_RESIGN_DATE] )RETURNIF (ISFILTERED ( 'EMP_TABLE'[EMP_STATE] ),IF ([XTOY] = [YTOX],BLANK (),IF ( _selreldate > [vToday], 0, [XTOY] - [YTOX] )),BLANK ())Also, it is worth noting that if you want to implement this "dynamic" feature it is not appropriate to get the duration days by creating a calculated column [DurDays]. So you have to use the measure [Duration days] instead of the calculated column [DurDays]. For more information about the difference between calculated columns and measure, you can read the following blogs.
Calculated Columns and Measures in DAX
Calculated Columns vs Measures
Best Regards
14 Replies
- Greg_DecklerCommunity Champion
saivina2920 This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907- saivina2920Post Prodigy
Thanks for your help.
When you are look at my Test pbix file, it's showing more emp_no record. also, the future date count should not come.
can you pls. check the file and give us th correct count please..?
- AnonymousNot applicable
Hi saivina2920 ,
I updated your sample pbix file(see attachment), please check whether that is what you want.
Measure = VAR _selemp = SELECTEDVALUE ( 'EMP_TABLE'[EMP_NO] ) VAR _count = CALCULATE ( DISTINCTCOUNT ( 'EMP_TABLE'[EMP_STATUS] ), FILTER ( ALLSELECTED ( 'EMP_TABLE' ), 'EMP_TABLE'[EMP_NO] = _selemp ) ) VAR _selreldate = SELECTEDVALUE ( EMP_TABLE[EMP_RELIEVE_DATE] ) RETURN IF ( _selreldate > [vToday] || _count > 1, BLANK (), DATEDIFF ( SELECTEDVALUE ( EMP_TABLE[EMP_RESIGN_DATE] ), TODAY (), DAY ) )Best Regards