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.
Hello,
I have the following measure
Solved! Go to Solution.
Hi @Natalia10000 ,
I understand what you mean, but there is no way to dynamically add parameters to ALLEXCEPT, the method in reply 2 is an alternative. Or you could consider the ALLSELECTED function and see if it achieves your desired result.
PercentageofTotal2 =
var TotalKPI = CALCULATE(
[Calculation KPI],
ALLSELECTED(dimarticle))
RETURN
DIVIDE([Calculation KPI],TotalKPI)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Natalia10000 ,
You can use ISFILTERED function to check if a column is being filtered.
PercentageofTotal2 =
VAR TotalKPI1 =
CALCULATE (
[Calculation KPI],
ALLEXCEPT (
dimarticle,
dimarticle[MerchandiseCategoryACGDesc],
dimarticle[ProductAllocation]
)
)
VAR _1 =
DIVIDE ( [Calculation KPI], TotalKPI1 )
VAR TotalKPI2 =
CALCULATE (
[Calculation KPI],
ALLEXCEPT (
dimarticle,
dimarticle[MerchandiseCategoryACGDesc],
dimarticle[ProductAllocation],
dimarticle[Category]
)
)
VAR _2 =
DIVIDE ( [Calculation KPI], TotalKPI2 )
RETURN
IF ( ISFILTERED ( dimarticle[Category] ), _2, _1 )
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank You, but do You know another way? Because I would need to add more to ALLEXCEPT because I have several filters on dimarticle, if I would use ISFILETERED that would mean lots of conditions
Hi @Natalia10000 ,
I understand what you mean, but there is no way to dynamically add parameters to ALLEXCEPT, the method in reply 2 is an alternative. Or you could consider the ALLSELECTED function and see if it achieves your desired result.
PercentageofTotal2 =
var TotalKPI = CALCULATE(
[Calculation KPI],
ALLSELECTED(dimarticle))
RETURN
DIVIDE([Calculation KPI],TotalKPI)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |