Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am new to the wqorld of DAX and Power BI...
I have created the following 2 measures but they dont work...
Solved! Go to Solution.
@DDL1976 The former isn't working due to a mechanism know as "Context Transition", pretty sophisticated thing but you will get a hang of it soon.
For now write your code like this:
AC =
VAR CurrentFinancialYear = [CFY]
VAR DateFilter =
FILTER ( DimPeriod, DimPeriod[Financial Year] = CurrentFinancialYear )
VAR Result =
CALCULATE ( SUM ( FactTransactionLine[Value] ), DateFilter )
RETURN
Result
And once you are comfortable with DAX write it like this:
AC =
VAR CurrentFinancialYear = [CFY]
VAR Result =
CALCULATE (
SUM ( FactTransactionLine[Value] ),
KEEPFILTERS ( DimPeriod[Financial Year] = CurrentFinancialYear )
)
RETURN
Result
Thats amazing thank you!
@DDL1976 The former isn't working due to a mechanism know as "Context Transition", pretty sophisticated thing but you will get a hang of it soon.
For now write your code like this:
AC =
VAR CurrentFinancialYear = [CFY]
VAR DateFilter =
FILTER ( DimPeriod, DimPeriod[Financial Year] = CurrentFinancialYear )
VAR Result =
CALCULATE ( SUM ( FactTransactionLine[Value] ), DateFilter )
RETURN
Result
And once you are comfortable with DAX write it like this:
AC =
VAR CurrentFinancialYear = [CFY]
VAR Result =
CALCULATE (
SUM ( FactTransactionLine[Value] ),
KEEPFILTERS ( DimPeriod[Financial Year] = CurrentFinancialYear )
)
RETURN
Result
User | Count |
---|---|
56 | |
22 | |
19 | |
16 | |
11 |
User | Count |
---|---|
85 | |
54 | |
39 | |
21 | |
18 |