Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello all,
I am struggling with how to create one complex calculated column. Desired calculated column is in orange Active Channel Customer.
The idea is to use the column Active Channel Account to create a new column Active Channel Customer
- If the account is active in a specific month, then the Active Channel Account will be a channel for customer level - column Active Channel Customer
- If there are 2 types of channels then the value in the calculated column is going to be "both"
| Report Date | Account | Customer | Active | Active Channel Account | Active Channel Customer |
| 6/30/2022 | a1 | A | FALSE | Reseller | |
| 6/30/2022 | a2 | A | TRUE | Reseller | Reseller |
| 6/30/2022 | a3 | A | FALSE | Reseller | |
| 6/30/2022 | a4 | A | TRUE | Reseller | Reseller |
| 7/31/2022 | a1 | A | FALSE | Direct | |
| 7/31/2022 | a2 | A | FALSE | Direct | |
| 7/31/2022 | a3 | A | TRUE | Direct | Direct |
| 7/31/2022 | a4 | A | FALSE | Direct | |
| 6/30/2022 | b1 | b | TRUE | Direct | Both |
| 6/30/2022 | b2 | b | TRUE | Reseller | Both |
Any help or advice is welcome.
Thanks!
Solved! Go to Solution.
@tomislav_mi , Try a new column like
new column =
var _1 = countx(filter(Table, [Customer] = earlier([Customer]) && [Report Date] = earlier([Report Date]) && [Active Channel] = "Reseller"), [Customer])
var _2 = countx(filter(Table, [Customer] = earlier([Customer]) && [Report Date] = earlier([Report Date]) && [Active Channel] = "Direct"), [Customer])
return
Switch(true(),
not(isblank(_1)) && not(isblank(_2)) , "Both",
not(isblank(_1)),"Reseller",
"Direct"
)
@tomislav_mi , Try a new column like
new column =
var _1 = countx(filter(Table, [Customer] = earlier([Customer]) && [Report Date] = earlier([Report Date]) && [Active Channel] = "Reseller"), [Customer])
var _2 = countx(filter(Table, [Customer] = earlier([Customer]) && [Report Date] = earlier([Report Date]) && [Active Channel] = "Direct"), [Customer])
return
Switch(true(),
not(isblank(_1)) && not(isblank(_2)) , "Both",
not(isblank(_1)),"Reseller",
"Direct"
)
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 26 | |
| 24 | |
| 19 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 46 | |
| 46 | |
| 43 | |
| 36 | |
| 33 |