Forum Discussion
Usung a measure
Hi I am trying to create a measure on the following
I want a multi row card to pull the following
Calculate the number of rows where the type is "Underactive", where the dept is "claims",the reason is "write off" and sum the total amount.
Thank you
CALCULATE (
SUM ( Table[cost]),Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- Anonymous1 year ago
Hi gra_197 ,
Thanks for reaching out to the Microsoft fabric community forum.
I’ve revalidated your updated requirement, and you’re absolutely right the original measure shared above works perfectly to calculate the sum of cost where Type = "Underactive", dept = "Claim" and reason = "Write off". To also include the count of rows matching the same filters, I created a second measure using COUNTROWS inside the same filter logic.
Here’s the additiona measure:
Row Count Measure =
CALCULATE (
COUNTROWS ( 'DataTable' ),
'DataTable'[Type] = "Underactive",
'DataTable'[dept] = "Claim",
'DataTable'[reason] = "Write off"
)
With this, you’ll get two outputs side-by-side one for the total cost (which returns 350 in the sample data) and the other showing the number of matching records (which is 2 in this case). This way, your full requirement is completely handled. Let me know if you’d like to display both values in the same visual or combine the logic in a more dynamic formatPlease find the attached pbix file for your reference.
Best Regards,
Tejaswi.
Community Support
4 Replies
- FBergamaschi
Super User
CALCULATE (
SUM ( Table[cost]),Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- gra_197
Helper II
FBergamaschi this is great to give me the sum, however I also need to to count the number of rows aswell
- FBergamaschi
Super User
Very easy with another measure
CALCULATE (
COUNTROWS ( Table ),Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI