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
Andreas_P
New Member

How to show the % of a column sum in one table vs the count value of a column from another

 
 

Hi i am looking for some help to setup the below:

  I have setup this very simple model with two tables. Customer_Master and Distribution_Data which shows distribution of products to customer outlets. Connected to each other via the customer_id field.

 

The number you see on the bar chart , first bar for example, shows that product JWRL 700 is at 1569 customers.

Now 1569 is not the whole customer universe. To find this you need to count the different customer_ids from the Customer_master table which includes all customers.

What I want to show is the % of the value shown in the bar chart (which the sum of a column (Distribution of element (0/1) from the Distribution_data table) versus the count of the total customers.

So basically the percentage of the sum of values from one column in one table against the count of a column from another table.

Aim is to see in a second bar on the same chart that 1569 is actually 90% of the total customers.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try New measures

custoomer for product = calculate(count(Distribution_Data[customer_ID])
overall customers = calculate(count(Customer_Master[ID]),all(Distribution_Data))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @Andreas_P 

You could use "ALL" Function as amitchandak said to get it. here are two blog for you refer to:

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://radacad.com/now-you-see-me-use-cases-of-all-dax-function-in-power-bi

If you still have problem, please share a simple pbix file and your expected output.

 

Regards,

Lin

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

Try New measures

custoomer for product = calculate(count(Distribution_Data[customer_ID])
overall customers = calculate(count(Customer_Master[ID]),all(Distribution_Data))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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.