The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I am trying to create a measure the aggregrates Net Balance but we need to filter that on a few different conditions.
We have three Tables:
Balance (Factish table), Cost Center (DIM), Account(DIM).
The business logic is: Sum all Net Balances where:
Balance Type is "Actual", the Cost Center Parent is "Sales" and the Acct 5 is "OP"
or
Balance Type is "Actual", the Cost Center Code is "2202", and the Acct 5 is "OP
or
Balance Type is "Actual", Acct 6 is "Other"
My Dax is =
CALCULATE ( SUM ( 'Balance'[Net Balance] ), 'Balance'[Balance Type] = "ACTUAL" && 'Cost Center'[Cost Center Parent] = "Sales" && 'Balance'[Acct 5] = "OP" || 'Balance'[Balance Type] = "ACTUAL" && 'Balance'[Cost Center Code] = "2202" && 'Balance'[Acct 5] = ",OP" || 'Balance'[Balance Type] = "ACTUAL" && 'Balance'[Acct 6] = "Other")
However, this doesn't not work. I get the following:
Any help or direction on this would be great. Thanks in advanced.
Solved! Go to Solution.
This did not work. Still have the same issue. I solve this by create a Variable in my measure to hold each criteria groups. Then return the Variables added together.
Measure =
var _Cat1 = Cat 1 logic
var _Cat2 = Cat 2 logic
var _Cat3 = Cat 3 logic
return
(_Cat1 + _Cat2 + _Cat3)
Don't use Filter, do the following instead
This did not work. Still have the same issue. I solve this by create a Variable in my measure to hold each criteria groups. Then return the Variables added together.
Measure =
var _Cat1 = Cat 1 logic
var _Cat2 = Cat 2 logic
var _Cat3 = Cat 3 logic
return
(_Cat1 + _Cat2 + _Cat3)
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |