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.
I have the following schema :
I am using a live connection to this SSAS Tabular cube, I want to calculate the amount of the Products with Status = Available
for each product comparing to the total amount of Products with Status=Available.
The dax query is like below :
Montant =
VAR MontantA =
CALCULATE (
SUM(FactTable[montant]),
dim_status[labelstatus] = "Available" ,
FactTable[ProductSK] <> -1
)
)
VAR MontantTotal =
CALCULATE (
SUM(FactTable[montant]),
dim_status[labelstatus] = "Available"
)
RETURN
DIVIDE (
MontantA,
MontantTotal
)
Solved! Go to Solution.
Hi,
When calculating totals like these you should include ALL() to your calculations. This is to remove any filters affecting the calculation.
E.g.
Montant =
VAR MontantA =
CALCULATE (
SUM(FactTable[montant]),
,ALL(FactTable)
dim_status[labelstatus] = "Available" ,
FactTable[ProductSK] <> -1
)
)
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi,
When calculating totals like these you should include ALL() to your calculations. This is to remove any filters affecting the calculation.
E.g.
Montant =
VAR MontantA =
CALCULATE (
SUM(FactTable[montant]),
,ALL(FactTable)
dim_status[labelstatus] = "Available" ,
FactTable[ProductSK] <> -1
)
)
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
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 |
---|---|
100 | |
99 | |
76 | |
66 | |
61 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |