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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
NewbieJono
Post Partisan
Post Partisan

Applying a Weighting to a set of percentages

Hello, i need to apply a weighting to a percentage result for four transactions. i can then add up the four weighted results to give and over score.

 

i have Dax to show the percentage YTD, this works fine. i also have a sample rate table to show what weighting to apply.

 

i can do this in excel but not sure about DAX.

 

Excel formula is Percentage YTD * Sample Rate / 100

 

Capture.PNG

 

I have a table that shows what sample rate to apply depending on date. The results are monthly figures. i am not sure how i tell power bi to lookup the appropriate sample rate

 

Capture.PNG

 

 

 

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

Hi @Wilson_ ,thanks for the quick reply.

Hi @NewbieJono ,

The Table data is shown below:

vzhouwenmsft_0-1711704076734.png

vzhouwenmsft_1-1711704108774.png

Please follow these steps:

1.Use the following DAX expression to create a table named 'Table3'

Table3 = FILTER('Table2','Table2'[Date From] = DATE(2023,7,1))

2.Use the following DAX expression to create a column named 'Sample Rate' in 'Table'

Sample Rate = LOOKUPVALUE(Table3[Sample Rate],'Table3'[Transaction],'Table'[Transaction Service])

3.Use the following DAX expression to create a column named 'Result' in 'Table'

Result = [Percentage YTD] * [Sample Rate] / 100

4.Use the following DAX expression to create a measure

Measure = IF(SELECTEDVALUE('Table'[Percentage YTD]),SELECTEDVALUE('Table'[Result]),SUM('Table'[Result]))

5.Final output

vzhouwenmsft_2-1711704458375.png

vzhouwenmsft_3-1711704490546.png

 

Best Regards,
Wenbin Zhou
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-zhouwen-msft
Community Support
Community Support

Hi @Wilson_ ,thanks for the quick reply.

Hi @NewbieJono ,

The Table data is shown below:

vzhouwenmsft_0-1711704076734.png

vzhouwenmsft_1-1711704108774.png

Please follow these steps:

1.Use the following DAX expression to create a table named 'Table3'

Table3 = FILTER('Table2','Table2'[Date From] = DATE(2023,7,1))

2.Use the following DAX expression to create a column named 'Sample Rate' in 'Table'

Sample Rate = LOOKUPVALUE(Table3[Sample Rate],'Table3'[Transaction],'Table'[Transaction Service])

3.Use the following DAX expression to create a column named 'Result' in 'Table'

Result = [Percentage YTD] * [Sample Rate] / 100

4.Use the following DAX expression to create a measure

Measure = IF(SELECTEDVALUE('Table'[Percentage YTD]),SELECTEDVALUE('Table'[Result]),SUM('Table'[Result]))

5.Final output

vzhouwenmsft_2-1711704458375.png

vzhouwenmsft_3-1711704490546.png

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Wilson_
Super User
Super User

Hi NewbieJono,

 

Can you share a little more? For example, what does your data model look like? When you say depending on date, what date does it depend on? etc.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.