March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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
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
Solved! Go to Solution.
Hi @Wilson_ ,thanks for the quick reply.
Hi @NewbieJono ,
The Table data is shown below:
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
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.
Hi @Wilson_ ,thanks for the quick reply.
Hi @NewbieJono ,
The Table data is shown below:
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
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.
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.
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
73 | |
67 | |
49 |
User | Count |
---|---|
199 | |
141 | |
97 | |
79 | |
68 |