Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
Is it possible to have difference of sales between Years for current visual ?
Sales are from Fact table.
Years and Month from Date table.
Thanks,
Srikanth
Solved! Go to Solution.
create w measure as follow :
measure =
var current_year = max(dimdate[year])
var prev_year = current_year - 1
var current_year_calc = sum(tbl_name[col_name])
var prev_year_calc =
calculate (
sum(tbl_name[col_name]),
all(dimdate),
dimdate[year] = prev_year,
values(dimdate[month])
)
)
return
current_year_calc - prev_year_calc
let me know if it works for you .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution !✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
you can just add a switch statement at the end,
switch(
true() ,
current_sales = 0 || prev_sales = 0 , 0 , [your calculation])
let me know if you need any other help .
@kanth123 Should be: Better Year Over Year Change - Microsoft Fabric Community
Thanks for video. helped in creating optimized measures.
create w measure as follow :
measure =
var current_year = max(dimdate[year])
var prev_year = current_year - 1
var current_year_calc = sum(tbl_name[col_name])
var prev_year_calc =
calculate (
sum(tbl_name[col_name]),
all(dimdate),
dimdate[year] = prev_year,
values(dimdate[month])
)
)
return
current_year_calc - prev_year_calc
let me know if it works for you .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution !✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
This helps but not 100%, when there are no sales in Current or Prior year it should be 0.
you can just add a switch statement at the end,
switch(
true() ,
current_sales = 0 || prev_sales = 0 , 0 , [your calculation])
let me know if you need any other help .
User | Count |
---|---|
91 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
72 | |
60 | |
59 |