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.
I have some Fact Revenue, I am trying to group by Conca, and display the values only if negative…
For doing it I have this calculated column:
=
VAR name1 = Revenue[Conca]
VAR name2=
CALCULATE (
SUM ( Revenue[CostOfQuality] ),
FILTER ( Revenue, Revenue[Conca] = name1 )
)
RETURN
if (name2>0, 0, Revenue[CostOfQuality])
It works:
(highest value is 0 as expected).
But if I drag fiscal year it stops working:
Why is it that I see numbers higher than 0?? (I want it to still work even if I bring other filters...)
Hi @Anonymous ,
You can try the following code I modified:
Var name2= CALCULATE (
SUM ( Revenue[CostOfQuality] ),Filter(Revenue,Revenue[Conca] =EARLIER(Revenue[Conca]))
)
RETURN
if (name2>0, 0, Revenue[CostOfQuality])
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Calculated columns are only calculated during data refresh, so they don't pay any attention to filters or slicers. If you want the results to dynamically react to filters and slicers you need to create a measure, not a calculated column.
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |