The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
Appreciate if someone could help me. Thank you
I have a pivot table and would like to add new measure
I would like to calculate weights for each row. Sample as below
if row number=1 then 0.06
else 0.94 * previous row value
Solved! Go to Solution.
Hi @Isma ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure =
IF (
MAX ( 'Table'[Row number] ) = 1,
MAX ( 'Table'[Row number] ) * 0.06,
0.06
* POWER ( 0.94, MAX ( 'Table'[Row number] ) - 1 )
)
If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Isma ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure =
IF (
MAX ( 'Table'[Row number] ) = 1,
MAX ( 'Table'[Row number] ) * 0.06,
0.06
* POWER ( 0.94, MAX ( 'Table'[Row number] ) - 1 )
)
If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Sorry that I only know how to do this in Power Query.
If you are interested in knowing how to do this in Power Query, please check the attached file.
1. Open pbix file
2. go to "Transform data"
3. New source -> blank query -> create a function.
when you open advanced editor, you can see the query like below.
let
Source = (x as number) as number =>
let f = function(x-1) * 0.94
in
if x=1 then 0.06 else f
in
Source
4. In Data query, add invoke custom function.
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |