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.
Hello,
I want to apply Simpson's rule on a table and create a new table to store the values. From the picture below, I have a TABLE and I want a calculated Table. There are multiple values in Area column and I want to apply the formula on each value of Area (i.e Group By). The formula can be seen in the formula bar.
Any help on this will be appreciated.
Thanks,
Vivian.
Solved! Go to Solution.
@Stachu @Ashish_Mathur Thanks for the solutions. But I found an easy way to solve this problem. All I did was used Pivot feature in the edit query to Convert Rows of column "Steps" as columns with values as the column "value" in it.
After doing this I got individual columns for each step, Table after pivoting looked like
Area | step 0.02 | step 0.01| step 0.005 |...........
A | 0 | 0 | 0.6 |............
then I just applied the formula using the calculated column.
@Stachu @Ashish_Mathur Thanks for the solutions. But I found an easy way to solve this problem. All I did was used Pivot feature in the edit query to Convert Rows of column "Steps" as columns with values as the column "value" in it.
After doing this I got individual columns for each step, Table after pivoting looked like
Area | step 0.02 | step 0.01| step 0.005 |...........
A | 0 | 0 | 0.6 |............
then I just applied the formula using the calculated column.
Hi,
For each Area, will the entries in the steps column have to be arranged in descending order (as i can observe in your example)?
Hi,
You may download my PBI file from here.
Hope this helps.
in your original table add these 2 columns:
NextStep = VAR __Area = 'Table'[Area] VAR __Step = 'Table'[Steps] RETURN CALCULATE(MAX('Table'[Steps]), FILTER(ALL('Table'), 'Table'[Area] = __Area && 'Table'[Steps]<__Step))
NextValue = VAR __Area = 'Table'[Area] VAR __Step = 'Table'[NextStep] RETURN CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),'Table'[Area] = __Area && 'Table'[Steps]= __Step))
then create a new table like this
Table2 = GROUPBY ( 'Table', 'Table'[Area], "Val", SUMX ( CURRENTGROUP (), 0.5 * ( [Value] + [NextValue] ) * ( [Steps] - [NextStep] ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |