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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Get Sum of a measure in row context

Hello, 

I have a table of Assignments and a table Employees.

I want to get Howmany days in the filter are within every assignment start and end date ... to get the employee booking hours within the selected month and year only

For Example I selected Employee= Keerthi and month=March 2022 ... you can see that the column  **Demand_Days_of_task_in_period  will only count the days of this assignment that is within my date selection , so only march days are counted while feb and may are not.

The measure formula

** Demand_Days_of_task_in_period = CALCULATE(COUNTROWS('Date'),FILTER('Date','Date'[Date]>=MIN(Assignments[AssignmentStartDate])&&'Date'[Date]<=MIN(Assignments[AssignmentFinishDate])))

 

johndha_1-1653391327488.png

 

The requirement:

I want to access this measure out of row context, meaning that when I add it to a card it will sum all the rows values (6+1+1+1+2+2+2+2+1)= 18 .. but as you can see the card on the top right which is with the same measure is giving me blank, it will only give me a value when I select a specific row ...

 

I searched for it but found most ways are through creating a calculated column, while the measure here will depend on the user selection of the date

 

 

Thanks for help

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create another new measure as below base on the current measure [Demand_Days_of_task_in_period] and apply the new measure onto the Card visual...

Measure =
SUMX (
    GROUPBY ( 'Assignments', 'Assignments'[Employee Name], 'Assignments'[TaskName] ),
    [Demand_Days_of_task_in_period]
)

In addition, you can refer the method in the following links to handle with incorrect total values on the matrix visual...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you so much, That helped alot

Anonymous
Not applicable

Hi @Anonymous ,

You can create another new measure as below base on the current measure [Demand_Days_of_task_in_period] and apply the new measure onto the Card visual...

Measure =
SUMX (
    GROUPBY ( 'Assignments', 'Assignments'[Employee Name], 'Assignments'[TaskName] ),
    [Demand_Days_of_task_in_period]
)

In addition, you can refer the method in the following links to handle with incorrect total values on the matrix visual...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.