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.
I want to create a measure that would use another measure that is the variance of salesvalues from 2019 and 2020 using the following filters. Not sure how that DAX command would look like.
The most important observation about your model is that it's wrong and you should change it. Hard-coding the names of years in your measures or fields is a clear sign you should really try to make an effort and learn the rules of data modeling for Power BI. If you don't do this... well, you'll be in trouble very soon and rather sooner than later.
NewMeasure =
IF (
AND ( [SALES_VALUE for 2019] <> 0, [SALES_VALUE for 2020] <> 0 ),
[SALES_VALUE for 2020] - [SALES_VALUE for 2019]
)
User | Count |
---|---|
15 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |