Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi friends,
I would like to achieve this using DAX. I have achieved this actually credits one of our friends here who provided the correct DAX.
But I needed to change something.
In the image is what I want to get. I already got to create a row sequence if they have the same value of Column 1 using the DAX below. Now I want to add a parameter to put a sequence based on the Column 2.
Solved! Go to Solution.
@JofrainVisda Not sure why you need to get so complicated with your original formula, you can do the same thing like this:
Column Row Easy =
VAR __Index = [Index]
VAR __Mod = MOD([Index], 3)
VAR __Table = ADDCOLUMNS('vw_AssignedChecklist2 (2)', "__ModColumn", MOD([Index], 3))
VAR __Return = COUNTROWS(FILTER( __Table, [__ModColumn] = __Mod && [Index] <= __Index))
RETURN
__Return
For the other one, you can do this:
Seq Column 2 =
VAR __Value = [Column2]
VAR __Values = DISTINCT('vw_AssignedChecklist2 (2)'[Column2])
VAR __Path = CONCATENATEX(__Values, [Column2], "|",[Index])
VAR __Count = COUNTROWS(__Values)
VAR __Table =
ADDCOLUMNS(
GENERATESERIES(1, __Count, 1),
"__Item", PATHITEM( __Path, [Value], TEXT)
)
VAR __Return = MAXX(FILTER(__Table, [__Item] = __Value), [Value])
RETURN
__Return
PBIX is attached below signature.
@JofrainVisda Not sure why you need to get so complicated with your original formula, you can do the same thing like this:
Column Row Easy =
VAR __Index = [Index]
VAR __Mod = MOD([Index], 3)
VAR __Table = ADDCOLUMNS('vw_AssignedChecklist2 (2)', "__ModColumn", MOD([Index], 3))
VAR __Return = COUNTROWS(FILTER( __Table, [__ModColumn] = __Mod && [Index] <= __Index))
RETURN
__Return
For the other one, you can do this:
Seq Column 2 =
VAR __Value = [Column2]
VAR __Values = DISTINCT('vw_AssignedChecklist2 (2)'[Column2])
VAR __Path = CONCATENATEX(__Values, [Column2], "|",[Index])
VAR __Count = COUNTROWS(__Values)
VAR __Table =
ADDCOLUMNS(
GENERATESERIES(1, __Count, 1),
"__Item", PATHITEM( __Path, [Value], TEXT)
)
VAR __Return = MAXX(FILTER(__Table, [__Item] = __Value), [Value])
RETURN
__Return
PBIX is attached below signature.
Try :
Column Row =
ROWNUMBER(
SUMMARIZE(
ALLSELECTED('vw_AssignedChecklist2 (2)'),
'vw_AssignedChecklist2 (2)'[Column 2], // Partition by Column 2
'vw_AssignedChecklist2 (2)'[Column 1], // Then by Column 1
"Index", 'vw_AssignedChecklist2 (2)'[Index] // Include Index for ordering within partitions
),
ORDERBY('vw_AssignedChecklist2 (2)'[Column 2], ASC,
'vw_AssignedChecklist2 (2)'[Column 1], ASC,
'vw_AssignedChecklist2 (2)'[Index], ASC), // Order by Column 2, then Column 1, then Index
DEFAULT,
PARTITIONBY('vw_AssignedChecklist2 (2)'[Column 2],
'vw_AssignedChecklist2 (2)'[Column 1]) // Partition by both Column 2 and Column 1
)
User | Count |
---|---|
93 | |
86 | |
78 | |
72 | |
66 |
User | Count |
---|---|
115 | |
106 | |
85 | |
65 | |
64 |