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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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