Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Below is the measure and above is the values table (contracts x Fiscal Year x Cost per FY)
My values are all correct -- giving me the $$ that each contract will pay during the relavent FYs.
However, the Total column is very wrong. Appears to be giving me conCost / numDays. I would love some support to understand why this is happening and how to fix it.
(Filter FY Range returns 1 for each FY during the Contract date range. Returns blank otherwise)
Solved! Go to Solution.
Hi @Chewbaklava
@SELECTEDVALUE returns blank at the total level for most of (if not all) the variables. Even if you change to MAX or MIN the result at the total level will allways be wrong.
please try
Cost per FY =
SUMX (
VALUES ( FY[Fiscal Year] ),
CALCULATE (
VAR constart =
SELECTEDVALUE ( contracts[Start] )
VAR conEd =
SELECTEDVALUE ( contracts[End] )
VAR conCost =
SELECTEDVALUE ( contracts[Total Cost] )
VAR numDays =
DATEDIFF ( conStart, conEnd, DAY ) + 1
VAR daysinfy =
DATEDIFF (
MAX ( conStart, CALCULATE ( SELECTEDVALUE ( FY[FY Start] ) ) ),
MIN (
COALESCE ( conEnd, CALCULATE ( SELECTEDVALUE ( FY[FY end] ) ) ),
CALCULATE ( SELECTEDVALUE ( FY[FY end] ) )
),
DAY
) + 1
RETURN
IF ( [Filter Fy Range], daysinfy * conCost / numDays, BLANK () )
)
)
Hi @Chewbaklava
@SELECTEDVALUE returns blank at the total level for most of (if not all) the variables. Even if you change to MAX or MIN the result at the total level will allways be wrong.
please try
Cost per FY =
SUMX (
VALUES ( FY[Fiscal Year] ),
CALCULATE (
VAR constart =
SELECTEDVALUE ( contracts[Start] )
VAR conEd =
SELECTEDVALUE ( contracts[End] )
VAR conCost =
SELECTEDVALUE ( contracts[Total Cost] )
VAR numDays =
DATEDIFF ( conStart, conEnd, DAY ) + 1
VAR daysinfy =
DATEDIFF (
MAX ( conStart, CALCULATE ( SELECTEDVALUE ( FY[FY Start] ) ) ),
MIN (
COALESCE ( conEnd, CALCULATE ( SELECTEDVALUE ( FY[FY end] ) ) ),
CALCULATE ( SELECTEDVALUE ( FY[FY end] ) )
),
DAY
) + 1
RETURN
IF ( [Filter Fy Range], daysinfy * conCost / numDays, BLANK () )
)
)
Brilliant, Tysm!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
26 | |
24 | |
12 | |
11 | |
10 |