Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All,
I am new to power bi and DAX,
I am trying to calculate count of a column in incremental way in a CALCULATED COLUMN so that i can find out how any times that value got repeated.
Data and required output as mentioned below
Any help please.
Thanks,
Mohan V.
Solved! Go to Solution.
@Anonymous
Use can do in Dax by sorting YEAR, then COLUMN1 and adding an index number in Power Query, then add below create below column in the model:
Result =
CALCULATE(
COUNTROWS('Table'),
CALCULATETABLE('Table',
'Table'[Sequence]<=EARLIER('Table'[Sequence])
)
)
It will be ideal to add it using Power Query:
Refer to this: poet and video: https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
Let me know if it doesn't work.
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous , you need add and index column
and then have it like this
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column = countx(filter(Table,[year] =earlier([Year]) && [column1] = earlier([column1]) && [index] <= earlier([index])),[index])
Hi @Anonymous ,
First, you need to create an index colum in query editor:
Then you can use the following calculated column:
Column = CALCULATE(COUNT('Table'[Column1]),FILTER(ALLEXCEPT('Table','Table'[Year],'Table'[Column1]),'Table'[Index]<=EARLIER('Table'[Index])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
First, you need to create an index colum in query editor:
Then you can use the following calculated column:
Column = CALCULATE(COUNT('Table'[Column1]),FILTER(ALLEXCEPT('Table','Table'[Year],'Table'[Column1]),'Table'[Index]<=EARLIER('Table'[Index])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous , you need add and index column
and then have it like this
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column = countx(filter(Table,[year] =earlier([Year]) && [column1] = earlier([column1]) && [index] <= earlier([index])),[index])
@Anonymous
Use can do in Dax by sorting YEAR, then COLUMN1 and adding an index number in Power Query, then add below create below column in the model:
Result =
CALCULATE(
COUNTROWS('Table'),
CALCULATETABLE('Table',
'Table'[Sequence]<=EARLIER('Table'[Sequence])
)
)
It will be ideal to add it using Power Query:
Refer to this: poet and video: https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
Let me know if it doesn't work.
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |