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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX For Weighted Column

Hello, I am looking to create a weighted calculation of data quality in the organization.

 

The data consits of the following columns:

Application

Data Quality Attribute

Data Subject Area

Business Usage

Violation Record ID

Violation Source Count

Source Column

Source Column Weight

 

The formula for Weighted Violations 

SUM(For every column calculate the source column weight, *  distinct count of violation record id)

 

Expected Output: Numerator

Filters: Everything is set to all

 

ColumnColumn WeightDistinct Count of Entities
Product of Weight * Entities
 
A8324 
B8216 
C224 
D428 
E8216 
F111 
G212 
H111 
J111 
   73
Expected Output

 

 

Filters: ScoreCard A is chosen

 

ColumnColumn WeightDistinct Count of Entities
Product of Weight * Entities
 
A8324 
C224 
D428 
F111 
H111 
   38

Expected Output

 

I have attached a link of power bi file and dummy data. 

 

https://www.dropbox.com/s/zids3ejrkkijb6i/attachments.zip?dl=0

 

This needs to work when select all is selected. 

1 ACCEPTED SOLUTION

Hi,

 

I believe this is the result you want.  You may download my PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

 

Your question is not clear.  In a simple Table, please show the expected result on the data that you have shared.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur I have added the requested information.

Hi,

 

I believe this is the result you want.  You may download my PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur Can you answer another query for me. 

 

If i wanted to calculate the sum of source keys for all data subject areas. How would that be done? This needs to be filterable by Application only.

 

Account 100000

Customer 5000

Total = 105000 (Expected Ans)

Hi,

 

I cannot understand your question.  Share the data and expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur If you look in the same data set used in your solution, every row has a Source Key Count attatched to it. For Account the value is 100K and for Customer it is 5K. I need the total to be 105K and it need to be filterable by Application column.

 

To simplify I am looking for the total number of sourcekeys per application. The issue is we have many rows per Data Subject Area(Account & Customer) per application.

Hi,

 

Sorry for the delay in replying.  I just saw your post.  I downloaded the file but am unable to understand your expected result.  Please let me know the exact answer/output you are expecting.  Thank you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur I added this as a seperate problem to avoid confusion, can you please have a look at it.

 

https://community.powerbi.com/t5/Desktop/Sum-of-Distinct-Values/m-p/539037#M253079

Anonymous
Not applicable

@Ashish_Mathur Let me try this again.

 

This is a data quality dashboard. Where I have a Source Column Dimension. Each source column belongs to a data subject area i.e. Account, Customer etc.

 

When I am looking at Data Subject Area for a particular CRM(Application) i.e. App1, App2. I have the total number of customers, and total number of accounts in the Source Entity Key Column. In this case those values are 5K and 100K respectively.

 

I want to calculate the total customer % as a % of the total records. i.e. 5000/(5000+100000) and 100000/(5000+100000). These calculations need to filterable by the Application and Data Subject Area Column.

 

 

Is this the info you need?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.