Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
81 | |
52 | |
39 | |
35 |
User | Count |
---|---|
95 | |
79 | |
52 | |
49 | |
47 |