The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi everyone,
I explain you my problem.
I need to create a table that helps me filter periods in the following way: for each ISO week selected in the slicer, I got returned the selected week, the previous one and the following one.
I'm trying to make it by ranking the ISO Weeks and use the ranks in order to make it possible to apply the +1/-1 logic.
My desired result should be a table like the following one:
Selected ISO Week (Rank), Returned ISO Week (Rank)
1, 0
1, 1
1, 2
2, 1
2, 2
2, 3
3, 2
3, 3
3, 4
and so on.
I've already tried multiple ways to make it in DAX but 0% successfull. Can anybody help me? 🙂
this code in power query
let
Source = {1..53},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each {0..53}),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
#"Expanded Custom"
try this
table = GENERATE(GENERATESERIES(1,53),SELECTCOLUMNS(GENERATESERIES(0,53),"Value2",[Value]))
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
64 | |
46 | |
41 |