Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
53 | |
38 | |
35 |
User | Count |
---|---|
100 | |
85 | |
47 | |
46 | |
46 |