The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
https://drive.google.com/file/d/14SNn2oaQ1m9H9hx1r0QCN0MDnCBei3Fo/view?usp=share_link
In the above report, i need a measure where, IF Month LFL for any previous months is Non LFL , then the following months in the same year should also show Non LFL for that particular category
Solved! Go to Solution.
Hi @Antmkjr
Please refer to attached file with the solution
Measure =
VAR CurrentMonth = MAX ( 'Date'[MonthOfYear] )
VAR CurrentYear = MAX ( 'Date'[Year] )
VAR T1 = CALCULATETABLE ( SUMMARIZE ( Sheet1, 'Date'[Year], 'Date'[MonthOfYear] ), REMOVEFILTERS ( ) )
VAR T2 = FILTER ( T1, [MonthOfYear] <= CurrentMonth && [Year] = CurrentYear )
VAR T3 =
SELECTCOLUMNS (
T2,
"@SPLY",
CALCULATE ( [Month LFL], FILTER ( T2, [MonthOfYear] = EARLIER ( [MonthOfYear] ) ), ALL ( 'Date' ) )
)
VAR Result = IF ( "Non LFL" IN T3, "Non LFL", "LFL" )
RETURN
Result
Hi @Antmkjr
Please refer to attached file with the solution
Measure =
VAR CurrentMonth = MAX ( 'Date'[MonthOfYear] )
VAR CurrentYear = MAX ( 'Date'[Year] )
VAR T1 = CALCULATETABLE ( SUMMARIZE ( Sheet1, 'Date'[Year], 'Date'[MonthOfYear] ), REMOVEFILTERS ( ) )
VAR T2 = FILTER ( T1, [MonthOfYear] <= CurrentMonth && [Year] = CurrentYear )
VAR T3 =
SELECTCOLUMNS (
T2,
"@SPLY",
CALCULATE ( [Month LFL], FILTER ( T2, [MonthOfYear] = EARLIER ( [MonthOfYear] ) ), ALL ( 'Date' ) )
)
VAR Result = IF ( "Non LFL" IN T3, "Non LFL", "LFL" )
RETURN
Result
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |