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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Amin_Adham
Regular Visitor

Measures created in a table, does not work and filter other tables.

Hello everyone.
I have been faced a problem as below details:

I have a timesheet table for our projects containing Month, Project Code and the total hours spent on each project monthly.

in another table, I have a financial transaction table which the costs, revenue, overhead etc are measured.
these two tables are not related in model.

the third table is connecting to both named project master.
it is a list of project with names and details (type, short name, code etc) which is connected to timesheet table through project code column and also to transaction table.

I want to create an allocated measure that allocates the overhead expenses to each project, based on the percent of their hours.

I created a measure for calculating the percent of total for each project as below:

Total Hours = CALCULATE(
    '01- Project Hours'[Hours],
    ALL(
        '01- Project Hours'[Project Code],
        '01- Project Hours'[Year],
        '01- Project Hours'[Month]
    )
)
and then:
Percent of total = '01- Project Hours'[Hours]/[Total Hours]

and it worked well. in hours table, i can use it for projects and months and it filters correctly.

but when I try to use this measure in my transaction table, it doesnt filter the projects

I now the problem is from my data Model, but please tell me how to fix it and what is the best data model for these kind of related tables.

2 REPLIES 2
amitchandak
Super User
Super User

@Amin_Adham , the above seem like a column not measure , measure should be like

 

Total Hours = CALCULATE(
Sum('01- Project Hours'[Hours]) ,
ALL(
'01- Project Hours'[Project Code],
'01- Project Hours'[Year],
'01- Project Hours'[Month]
)
)
and then:
Percent of total = divide(sum('01- Project Hours'[Hours]),[Total Hours])

 

Try the above and check

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Dear Amit and thanks for the respond and considration.

the measures are fine. I didnt use the SUM before '01- Project Hours'[Hours]  because it was a measure itself.

I forgot to mention I had another measure called: Hours wich is:

Hours = sum('01- Project Hours'[Hour])

So all my typings and formulas are just the same as you advised.
but when I use it on my other table, It doesnt filter them.

in it's own table, it's just working fine.
Amin_Adham_0-1684775216521.png

the next Measure I created is:

Allocated Overhead = CALCULATE[Overhead Expenses],  ALL( '00- JV List'[Month]))*[Percent of total]

Overhead expenses is also a measure:
Overhead Expenses =
CALCULATE(
    [Amount Dr (CR)],
    '00- JV List'[Title1]="Operational Expenses",
    '00- JV List'[Title4]= "Tehran Office"||
    '00- JV List'[Title4]= "Tenders"||
    ISBLANK('00- JV List'[Title4]||ALL('00- Persian Month'[Persian Month])))

here is the relationship between tables:

Amin_Adham_1-1684775434948.png

 

 

Kindly Please advise.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.