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 August 31st. Request your voucher.
Hello,
As the title says I want to calculate the sum of a column ignoring the slicers in place.
It can be done with ALL.
Measure=Calculate(sum(table[amounts]),All(Table))
However I also want to filter sum of the amounts to the value of another column , year.
Measure=Calculate(sum(table[amounts),Filter(table,Table[Year]="2020"))
Something like above but which ignores the slicers. Is it possible?
Thanks
Solved! Go to Solution.
@Anonymous , Not sure I got you completely. Try like
Measure=Calculate(sum(table[amounts),Filter(all(table),Table[Year]="2020"))
Hi @Anonymous ,
I created the data:
Here are the steps you can follow:
1. Create measure.
select =
var _selectyear=SELECTEDVALUE('Table'[Year])
return
IF(HASONEVALUE('Table'[date]),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Year]=_selectyear)),
SUMX(ALL('Table'),'Table'[amount]))
2. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I created the data:
Here are the steps you can follow:
1. Create measure.
select =
var _selectyear=SELECTEDVALUE('Table'[Year])
return
IF(HASONEVALUE('Table'[date]),
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Year]=_selectyear)),
SUMX(ALL('Table'),'Table'[amount]))
2. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @Anonymous . This works as well.
@amitchandak You did get me completely and your measure works for me. Thanks
Encouraged by your quick reply, I would like to ask another question.
What would you suggest if I want the slicer to be reactive but, the row context is to be ignored? In other words, the measure returns the sum as per the selected slicer but the total amount does not change to the row context.