Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 .
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |