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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chrismcdonald
Helper I
Helper I

Combine Measures

Hello,

 

I am trying to combine 2 measures that both work individually but I can't get them to work when combined. Please help.

 

The end result should only count the projects that matches the both criteria but also has all the subprojects completed for that project ID.

Example

Project IDSub ProjectDriverInstall Actual
11Urgent Work1/01/2020
12Urgent Work 
12Urgent Work1/01/2020
21Urgent Work2/02/2020
22Urgent Work2/02/2020
22Urgent Work

2/02/2020

 

Expected Result (showing only 1 because only 1 project has been fully completed)

 

DriverCount
Urgent Work1

 

This measure is used to roll up details to a project level. e.g 1 project ID might have multiple sub projects

 

Install Actual (Project Level) =

IF (

    CALCULATE (

        COUNTBLANK ( Table[Install Actual] ),

        ALLEXCEPT (Table, Table[Project ID] )

    ) > 0,

    BLANK (),

    CALCULATE ( MAX ( Table[Install Actual] ), ALLEXCEPT ( Table, Table[Project ID] ) ))

 

This measure is use to do a count of the Project ID's based on the filters

 

Urgent work Completed Last week=

         CALCULATE (

            DISTINCTCOUNT ( Table[Project ID] ),

            FILTER ( Table, Table[Week Index] = "-1" ),

            FILTER ('Table', Table[Driver] = "urgent work"))

 



1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@chrismcdonald , With description, I am not clear on missing measure.

The table you want to show, all sub project completed


countx(filter(summarize(Table,table[Project ID],"_1",count(Table[Sub Project]), "_2",countx(filter(Table,not(isblank(table[Install Actual]))),Table[Install Actual])),[_1] =[_2]),table[Project ID])

 

If you want to work with the week. Please Use date dimension and Week rank like this

This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

Refer my file

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@chrismcdonald , With description, I am not clear on missing measure.

The table you want to show, all sub project completed


countx(filter(summarize(Table,table[Project ID],"_1",count(Table[Sub Project]), "_2",countx(filter(Table,not(isblank(table[Install Actual]))),Table[Install Actual])),[_1] =[_2]),table[Project ID])

 

If you want to work with the week. Please Use date dimension and Week rank like this

This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

Refer my file

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

 

Thank you @amitchandak .. I am pretty sure this will work for what I need.

 

Thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.