Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RhoFox
Frequent Visitor

Count row with same values in two columns

Hi There

I need help with some column "count"

 

ProjectDateTextCount

P1

01.01.2021text11
P101.01.2021text22
P101.01.2021text33
P102.01.2021text41
P201.01.2021text51
P201.01.2021text62
P102.01.2021text72
P102.01.2021text83
P102.01.2021text94


I need to count number of rows when: Project is the same and Date is the same
i know it's not difficult, but unfortunately i can't find the right formula 😕

 

I am very grateful for every answer

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @RhoFox 

Please check the below for creating a new column.

 

Picture1.png

 

Count CC =
VAR currentproject = 'Table'[Project]
VAR currentdate = 'Table'[Date]
RETURN
RANKX (
FILTER (
'Table',
'Table'[Project] = currentproject
&& 'Table'[Date] = currentdate
),
'Table'[Text],
,
ASC
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @RhoFox 

Please check the below for creating a new column.

 

Picture1.png

 

Count CC =
VAR currentproject = 'Table'[Project]
VAR currentdate = 'Table'[Date]
RETURN
RANKX (
FILTER (
'Table',
'Table'[Project] = currentproject
&& 'Table'[Date] = currentdate
),
'Table'[Text],
,
ASC
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


ooooh it works 😄
thank you a lot
I just saw that I still have a problem, I have another column with true / false values, it should only count if the column = true

Hi, @RhoFox 

Thanks for your feedback.

Please share your sample pbix file's link here, then I can try to look into it.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


vanessafvg
Super User
Super User

you can do a

 

summarizetable =
SUMMARIZE ( table[Project], table[Date], "RowCount", COUNTROWS ( table ) )

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




selimovd
Super User
Super User

Hey @RhoFox ,

 

you can do that with a CALCULATE and then you can tell which column should be considered for the count with the ALLEXCEPT function:

Count Measure =
CALCULATE(
    COUNTROWS( myTable ),
    ALLEXCEPT(
        myTable,
        myTable[Project],
        myTable[Date]
    )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.