Forum Discussion
Counting rows with multiple categories per row.
- 1 year ago
Hi Dsmiith ,
Thank you for reaching out to us on the Microsoft Fabric Community Forum.
Please check below calculated column "PTI_Totalbiomassa_Flag" to represent the flag values, if the parameters are equal to "PTI" or "Totalbiomassa" the column gives 1, otherwise a blank.
1. Created sample data , please refer snap.
2. Created Calculated column with below DAX .
PTI_Totalbiomassa_Flag =VAR CurrentID = 'Table'[Vattenförekomstens id]VAR CurrentParameter = 'Table'[Parameter]VAR HasPTI =CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table', 'Table'[Vattenförekomstens id]),'Table'[Parameter] = "PTI") > 0VAR HasTotalbiomassa =CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table', 'Table'[Vattenförekomstens id]),'Table'[Parameter] = "Totalbiomassa") > 0RETURNIF(HasPTI && HasTotalbiomassa &&(CurrentParameter = "PTI" || CurrentParameter = "Totalbiomassa"),1,BLANK())3. please refer output snaps and attached PBIX file.If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
- 1 year ago
Hi, first group your data using ALLROWS
then add custom column
let
paramList = List.Transform([Allrows][Parameter], each _)
in
if List.Contains(paramList, "PTI") and List.Contains(paramList, "Totalbiomassa") then 1 else nulland then expand allrows column
Hi Dsmiith ,
Thank you for reaching out to us on the Microsoft Fabric Community Forum.
Please check below calculated column "PTI_Totalbiomassa_Flag" to represent the flag values, if the parameters are equal to "PTI" or "Totalbiomassa" the column gives 1, otherwise a blank.
1. Created sample data , please refer snap.
2. Created Calculated column with below DAX .
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi Dsmiith ,
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
- v-dineshya1 year ago
Community Support
Hi Dsmiith ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.
Thank you.
- v-dineshya1 year ago
Community Support
Hi @Dsmiith ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.
Thank you.