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
jabbajuice08
Frequent Visitor

Trying to get measure to work in visual that utilizes column from another table

Proj_Finish = 

VAR PROJ_FINISH = 
    SWITCH( TRUE(),
        SELECTEDVALUE(Parameters[Risk Type]) = "Low", MAX('Schedule Data'[Finish]) + 90,
        SELECTEDVALUE(Parameters[Risk Type]) = "Medium", MAX('Schedule Data'[Finish]) + 30,
        SELECTEDVALUE(Parameters[Risk Type]) = "High", MAX('Schedule Data'[Finish]) + 0,
        SELECTEDVALUE(Parameters[Risk Type]) = "Very High", MAX('Schedule Data'[Finish]) - 14)

VAR PROJ_ID = 
    CALCULATE(
         MAXX(
             'Accounting calendar'[ID], FILTER('Accounting calendar', PROJ_FINISH >= 
             'Accounting calendar'[MonthStartDate] && PROJ_FINISH <= 'Accounting 
              calendar'[MonthEndDate])) 

RETURN
    CALCULATE(
        SUM(
           'Table'[BLTC GRP]), 'Table'[BL Index]= PROJ_ID, 
           'Table'[IPT]=IF(HASONEVALUE('Schedule Data'[IPT]), VALUES('Schedule Data'[IPT], 
            BLANK()))

So here is my measure I created that dynamically changes the value [BLTC] depending on user selection. Basically, it sums up the BLTC in a new table I created and matches the BL Index to the PROJ_ID I created (This ID is related to the Accounting Calendar). 

 

My accounting calendar table is attached to my Schedule Data table using two inactive relationships (Schedule Data [FC Index] = Accounting calendar [ID] & Schedule Data [BL Index] = Accounting calendar [ID]). 

 

My visual is a line graph that already included two other measures to make up the lines. This graph uses Accounting calendar [Date] as the x axis. 

 

My Proj_Finish measure works perfectly in a table that utilizes fields from my Schedule Data table (Which gives you each tasks' individual BLTC amount). However, it shows up blank when I drag it into my visual because of the Accounting calendar[Date] on the x axis. What am I missing that I need to add on to this measure to make it work for my visual? I need this measure or a new measure to sum up the total BLTC by [Date]. 

 

 

3 REPLIES 3
lbendlin
Super User
Super User

My accounting calendar table is attached to my Schedule Data table using two inactive relationships (Schedule Data [FC Index] = Accounting calendar [ID] & Schedule Data [BL Index] = Accounting calendar [ID]).

That doesn't do you any good. Correct your data model to make a relationship active, either statically or via USERELATIONSHIP

Sorry, I should have specified. I do use userelationship to activate those relationships. However, my measure I created is dynamic so I can't use userelationship for that to another table.

I thought that's exactly what USERELATIONSHIP is for.  Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

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.