March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
17 | |
9 | |
5 |
User | Count |
---|---|
37 | |
29 | |
16 | |
14 | |
12 |