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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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