Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
User | Count |
---|---|
106 | |
86 | |
81 | |
73 | |
71 |
User | Count |
---|---|
111 | |
102 | |
97 | |
74 | |
67 |