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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Help with a measure for a pie chart

Hi,

 

I'm trying to create a measure to get the num/percentage of customer using my mobile app.  This can be determined by 2 tables but I haven't been able to get it to work.  My latest attempt is included below.

 

My main table is called Customers.  The PK is Customer_ID.  

 

The second table is called Interwebs.  Here is the structure:

 

Customer_ID

WWW_Mobile

 

There can be numerous records for each customer in the second table but I only care if there is 1 record where WWW_Mobile is greater than 0.  That is the number of mobile logins.  If a customer has at least 1 record like this, they need to be counted.  My goal was to take this number, subtract it from the number of distinct Customer_ID in the first table and that gets me the number/percentage of customer that are using my mobile app.  Below is the measure.  What am I doing wrong?

NumCustomersUsingMobile =
CALCULATE
(
DISTINCTCOUNT(Customers[Customer_ID])
)-
(
DISTINCTCOUNT(Interwebs[Customer_ID]), FILTER(Interwebs[WWW_Mobile] > 0)
)

 

Thanks!

2 REPLIES 2
TomMartens
Super User
Super User

Hey @Anonymous ,

 

from the description, and the DAX you provided I assume that the result returns the number of customers who are NOT using your mobile app, but maybe I'm wrong.

Can you please describe what the measure returns and why it does not match with your expectations.

 

Maybe you want to consider, to create a pbix file that contains some sample data, but still reflects your data model, upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi, 

 

I need both and can accept 1 measure and tweak it to make the other.

 

My file is below.  It has 6 total customers in both tables.  Customer_ID 2, 3, 5 and 6 are in the Interwebs table and have a value greater than 0 for the column called WWW_Mobile in the Interwebs file.  These need to be counted as users that logged in to my mobile app.  

 

http://s000.tinyupload.com/?file_id=00499369713469087346

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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