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.
I want to create a column that is the difference of adjacent variables.
Ex. Q1 = Sup_group 2-2 = 0 (Sup_group of Q1 - Sup_group of Q1)
Q2 = Sup_group 2-3 = -1 (Sup_group of Q1 - Sup_group of Q2)
Q3 = Sup_group 3-4 = -1 (Sup_group of Q2 - Sup_group of Q3)
Q4 = Sup_group 4-2 = -1 (Sup_group of Q3 - Sup_group of Q4)
result example.....
sample data....
help me please 😂
thank you,
Solved! Go to Solution.
Hi @only_me321
Please refer to attached sample file with the solution
Result =
VAR CurrentQuarter = 'Table'[Quarter]
VAR CurrentSupGroup = 'Table'[Sup_group]
VAR GroupProvinceTable = CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[group], 'Table'[province] ) )
VAR TableBefore = FILTER ( GroupProvinceTable, 'Table'[Quarter] < CurrentQuarter )
VAR PreviousRecord = TOPN ( 1, TableBefore, 'Table'[Quarter] )
VAR PreviousSupGroup = COALESCE ( MAXX ( PreviousRecord, 'Table'[Sup_group] ), CurrentSupGroup )
RETURN
PreviousSupGroup - CurrentSupGroup
Hi @only_me321
Please refer to attached sample file with the solution
Result =
VAR CurrentQuarter = 'Table'[Quarter]
VAR CurrentSupGroup = 'Table'[Sup_group]
VAR GroupProvinceTable = CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[group], 'Table'[province] ) )
VAR TableBefore = FILTER ( GroupProvinceTable, 'Table'[Quarter] < CurrentQuarter )
VAR PreviousRecord = TOPN ( 1, TableBefore, 'Table'[Quarter] )
VAR PreviousSupGroup = COALESCE ( MAXX ( PreviousRecord, 'Table'[Sup_group] ), CurrentSupGroup )
RETURN
PreviousSupGroup - CurrentSupGroup
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
5 |
User | Count |
---|---|
13 | |
12 | |
11 | |
9 | |
9 |