Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
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 would like to make calculations between row. Es.
COD. DESC. VAL
1 A 5
2 B 3
3 C NULL
I would like to put in the third row the calculation 5-3=2
Can anyone help me, please?
Thank you in advance.
Solved! Go to Solution.
Hello,
I found the solution that I wanted. I post her in case can be useful for someonelse.
I created a misure VALUE BIS
VALUES BIS =
VAR CURRENT_ROW=SELECTEDVALUE(TABLE[ID])
VAR ROW3=CALCULATE(SUM(VALUE),FILTER(ALL(TABLE),TABLE[ID]=1))-CALCULATE(SUM(VALUE),FILTER(ALL(TABLE),TABLE[ID]=2))
RETURN
SWITCH(CURRENT_ROW,3,ROW3,SUM(VALUE))
Best regards
@jgreutert , Try like. But logic is not extendable
maxx(filter(table,[COD] = earlier([COD]) -2),[VAL]) - maxx(filter(table,[COD] = earlier([COD]) -1),[VAL])
Is it possibile to do it as misure?
Many thanks for the useful answers!!
Hello,
I found the solution that I wanted. I post her in case can be useful for someonelse.
I created a misure VALUE BIS
VALUES BIS =
VAR CURRENT_ROW=SELECTEDVALUE(TABLE[ID])
VAR ROW3=CALCULATE(SUM(VALUE),FILTER(ALL(TABLE),TABLE[ID]=1))-CALCULATE(SUM(VALUE),FILTER(ALL(TABLE),TABLE[ID]=2))
RETURN
SWITCH(CURRENT_ROW,3,ROW3,SUM(VALUE))
Best regards
@jgreutert - Not sure you can really do that (replace the NULL with some value) if this is in an actual table. You could create a new column. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __Previous = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Value])
RETURN
__Current - __Previous
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 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |