Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi everybody!,
I'm having a problem trying to calculate this % change, what I need is quite simple i want to see the variation from 1/0 (299,87/82,97), 2/1 (336,56/299,87), 3/2 (318,29/336,56),etc.
There is anyway to do it?
Thanks
Solved! Go to Solution.
Hi @Anonymous
Assume you have data as below
Then create a measure
Measure =
VAR pre =
CALCULATE (
SUM ( 'Table'[value] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[group] ),
'Table'[index]
= MAX ( 'Table'[index] ) - 1
)
)
RETURN
IF ( pre = BLANK (), BLANK (), SUM ( 'Table'[value] ) / pre )
Hi @Anonymous
Assume you have data as below
Then create a measure
Measure =
VAR pre =
CALCULATE (
SUM ( 'Table'[value] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[group] ),
'Table'[index]
= MAX ( 'Table'[index] ) - 1
)
)
RETURN
IF ( pre = BLANK (), BLANK (), SUM ( 'Table'[value] ) / pre )
Hi @Anonymous ,
You will need to edit query in Power Query and go to Transform Tab, the Transpose button. That will give you the picture below. Back in Power BI add a column with the dax below to get the values you are after.
Please let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
percent change =
var _column1 ='Table'[Column1]
var _presvalue = 'Table'[Column2]
var _previndex = Calculate(MAX('Table'[Column1]), FILTER(All('Table'),'Table'[Column1]<_column1))
var _prevvalue = Calculate(MAX('Table'[Column2]),FILTER(All('Table'),'Table'[Column1]=_previndex))
return if ('Table'[Column1] > 0,Divide(_presvalue,_prevvalue),0)
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 34 | |
| 31 | |
| 30 |