Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
With some help from this community I have the following Dax code that is doing the following:
Solved! Go to Solution.
HI @Roym
Please try
Column =
VAR CurrentTest = 'Table'[Test]
VAR CurrentReview = 'Table'[Review]
VAR CurrentID = 'Table'[ID]
VAR CurrentsessionTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[session] ) )
VAR PreviousRecords =
FILTER (
CurrentsessionTable,
'Table'[ID] < CurrentID
&& 'Table'[Review] <> "Open"
)
VAR PreviousRecord =
TOPN ( 1, PreviousRecords, 'Table'[ID] )
VAR PreviousReview =
MAXX ( PreviousRecord, 'Table'[Review] )
VAR Result =
IF (
CurrentTest = "Effective",
SWITCH (
CurrentReview,
"Effective", "Effective",
"Ineffective", "Ineffective",
"Open", PreviousReview
)
)
RETURN
COALESCE ( Result, 'Table'[Test] )
HI @Roym
Please try
Column =
VAR CurrentTest = 'Table'[Test]
VAR CurrentReview = 'Table'[Review]
VAR CurrentID = 'Table'[ID]
VAR CurrentsessionTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[session] ) )
VAR PreviousRecords =
FILTER (
CurrentsessionTable,
'Table'[ID] < CurrentID
&& 'Table'[Review] <> "Open"
)
VAR PreviousRecord =
TOPN ( 1, PreviousRecords, 'Table'[ID] )
VAR PreviousReview =
MAXX ( PreviousRecord, 'Table'[Review] )
VAR Result =
IF (
CurrentTest = "Effective",
SWITCH (
CurrentReview,
"Effective", "Effective",
"Ineffective", "Ineffective",
"Open", PreviousReview
)
)
RETURN
COALESCE ( Result, 'Table'[Test] )
Great, this works perfectly!! Thanks!!
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!