Hi PBI’ers
I need to create the number of “subcases created” per week. There are two types of subcases: ones that contain “CDS” in the string, known as CDS subcases, and ones that don’t contain CDS in the string known as “commodity” subcases.
This is plotted on a line chart of current year vs last year. In some weeks there are 0 subcases created and I need the plot to show 0. I also need it to show nothing for the weeks that haven’t happened yet.
I’ve managed to get it to show zero, but for some reason I can’t use the variable in place of the week number in the below code, I have to update it manually each week. Or I can get it to work but the CDS 2025 line will show ‘0’ for all the weeks in the future as well.
Have stripped out all the confidential stuff, so if look at the file the subcase names are gibberish except for if it contains “CDS” in the string, I’m only counting the rows so it doesn’t matter what they say, apart from if it does or doesn’t contain “CDS”.
At the bottom of the dax below where it says “IF ( CurrentDate2 <= 24” I should be able to replace the 24 with the VAR CurrentDate2, but it doesn’t work. (for Fin Year week 24)
Any assistance much appreciated !
G1 CPA (CDS) "Created". Excl TODAY FY2025 NEW - needs weekly update =
VAR CurrentDate = [Current week number]
VAR maxdate =
MAX ( DateTable[Date] )
VAR CurrentDate2 =
( SELECTEDVALUE ( DateTable[FY Week Number] ) )
VAR CDS_2025 =
CALCULATE (
[G1 CPA (CDS) "Created". Excl TODAY (SRM)],
FILTER (
DateTable,
( DateTable[Current or Last FY] = "CurrentFY"
&& DateTable[FY Week Number] <= CurrentDate2 )
)
)
VAR CDS_2025_with_zero =
IF ( CurrentDate2 <= 24, IF ( ( CDS_2025 = BLANK () ), 0, CDS_2025 ), BLANK () )
RETURN
CDS_2025_with_zero