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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
adam12237
Advocate I
Advocate I

DAX to calculate number of distinct values in 2 columns in 2 tables - SSAS

I have a need for a single DAX expression in SSAS that would allow me to calculate the number of distinct memberIDs found within a Calls table and a Faxes table. I am using a tabular model in SSAS so I am unable to create any calculated columns. Any guidance is appreciated.

 

Thanks,

Adam

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @adam12237 ,

 

If you connect to SQL Server Analysis Services by using Live Connection, you can't model in Power BI Desktop.

Because in Live Connection mode, Power BI will connect the entire external model. Once connected, it can not be modified in Power BI, which means that you can only model the data in SSAS.

 

So for your problem, you have the following two solutions:

1. Calculate what you want in the data source .

2. Use Import mode.

 

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.

 

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @adam12237 ,

 

If you connect to SQL Server Analysis Services by using Live Connection, you can't model in Power BI Desktop.

Because in Live Connection mode, Power BI will connect the entire external model. Once connected, it can not be modified in Power BI, which means that you can only model the data in SSAS.

 

So for your problem, you have the following two solutions:

1. Calculate what you want in the data source .

2. Use Import mode.

 

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
Community Champion
Community Champion

So I think perhaps something like:

 

Measure =
  VAR __Calls = 'Calls'
  VAR __Faxes = 'Faxes'
  VAR __Table = 
    UNION(
      SELECTCOLUMNS(__Calls,"__MemberID",[MemberID]),
      SELECTCOLUMNS(__Faxes,"__MemberID",[MemberID])
    )
RETURN
  COUNTROWS(
    DISTINCT(
      __Table
    )
  )

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors