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 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
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 |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
48 | |
45 | |
19 | |
16 |