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 there!
Im having some trouble with comparing information. I have a data set like this (It's only annual information no months nor days)
Year | Amount
2015 | 123
2015 | 421
2014 | 321
2014 | 654
2013 | 987
2013 | 876
I want to compare the total Amount per year with the last year BUT using Slicers, so if i choose 2015 in the slicer, it will compare automatically with 2014, and if i choose 2014, it will be compared with 2013 and so on
any advice?
Solved! Go to Solution.
Hey,
one possible solution could be to create a measure that calculates the amount of previous year like so:
amount PY =
IF(HASONEFILTER('Table1'[Year]),
var py = values('Table1'[Year]) -1
return
CALCULATE(SUM('Table1'[Amount]),
'Table1'[Year] = py
),
BLANK()
)
Now you can use both measures in any visualization, if more than one year is selected or NONE, the measure returns a BLANK() / NULL value
Hope this is what you are looking for
Hey,
one possible solution could be to create a measure that calculates the amount of previous year like so:
amount PY =
IF(HASONEFILTER('Table1'[Year]),
var py = values('Table1'[Year]) -1
return
CALCULATE(SUM('Table1'[Amount]),
'Table1'[Year] = py
),
BLANK()
)
Now you can use both measures in any visualization, if more than one year is selected or NONE, the measure returns a BLANK() / NULL value
Hope this is what you are looking for
Thank you so much!
Just what i needed, i don't understand very well the whole formula (the py for example) but for sure is what i was looking for... ill look for more documentation!
THX
Hey,
what happens is this
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |