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
Bustardo
Helper I
Helper I

Combining distinctcount of a column across measures?

<p>I'm new to DAX, that said I'm having fun.</p>
<p>I'm trying to rewrite these 3 statements so that I can get a total of distinct User Id's from these 3 measures, but I'm having a hard time.</p>
<p>&nbsp;</p>
<pre>m1:=CALCULATE(DISTINCTCOUNT([UserID]), col_Ex1 = 1, UseRelationship(DimDate[Date],Fact[Exdate1]),DATESBETWEEN(DimDate[Date],[FYSTARTDATE],[FYENDDATE]))
m2:=CALCULATE(DISTINCTCOUNT([UserID]), col_Ex2 = 1, UseRelationship(DimDate[Date],Fact[Exdate2]),DATESBETWEEN(DimDate[Date],[FYSTARTDATE],[FYENDDATE]))
m3:=CALCULATE(DISTINCTCOUNT([UserID]), col_Ex3 = 1, UseRelationship(DimDate[Date],Fact[Exdate3]),DATESBETWEEN(DimDate[Date],[FYSTARTDATE],[FYENDDATE]))</pre>
<p>Is this possible? do I just have to re-write it and combine them? any help would be appreciated.</p>
3 REPLIES 3
Greg_Deckler
Super User
Super User

Why not just create an Append query to append all of these fact tables together into one?


Follow on LinkedIn
@ 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'm using ssas 2012 tabular, is that available (1103 compatibility). I am using power BI but connecting live.

Hi @Bustardo,

When using “Connect live” mode to connect to SSAS tabular in Power BI Desktop, we are not able to use “Append Query” feature in Query editor to merge data of multiple fact tables. In this case, you are able to create measures to calculate distinct count of UserID.

What is the error message or problem do you get when you create the above three measures in Power BI Desktop?


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.