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
NilR
Post Patron
Post Patron

Distinct Count doesn't match to Excel file raw data

I created Pivot in Excel and selected Distinct Count, however , the measure I created in PBI doesn't match to distinct count in Excel. Can you help me to fix my measure?

Excel: 

NilR_0-1619737604891.png

 

Measure:  

 

 

Var _Calc= CALCULATETABLE(
SUMMARIZE('COVID_INDV_PERIODS',[SERVICE_DESC],
"_COUNT", DISTINCTCOUNTNOBLANK('COVID_INDV_PERIODS'[ID])),
FILTER('COVID_INDV_PERIODS', [GP_NB]=_gpnb
&& [SERVICE_DESC]="Confirmed"
&& ([PAID_DATE] >= _min_Pdate && [PAID_DATE] <= _max_Pdate)
&& ([SERVICE_DATE] >= _min_SVCdate && [SERVICE_DATE] <= _max_SVCdate) ))

Return
SUMX(DISTINCT(_TempTable),[_COUNT])

 

 

 

 

Result in PBI which is wrong:

 

NilR_1-1619738178426.png

Thanks!

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @NilR ,

 

Please provide a sample data and I will try to rebuild the measure in Power BI Desktop.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@NilR Guessing but could be a casing problem. DAX ignores case so Greg and greg are 1 distinct value.


@ 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...

I checked, It's all Numbers ! Can I rewrite the measure in diff way? 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.