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
motyagi
Helper I
Helper I

Creating a new table to fix a calculation

Hi There, 

 

I am trying to fix a calculation to the Project Type and create a new column - the end  goal is to check 

 

 

If  ABS([$ Difference ])>sum([EP Balance Comparison])
then 'Out of Threshold'
else 'Within Threshold' END

 

Fixed at a project type detail. 

I want to used this new created field to color points on my scatter plot. Red for 'Out of Threshold'

1 ACCEPTED SOLUTION

 

HI @motyagi,

 

For your requirement ,you can use var function to store this summary table into measure formula.

 

If you need to lookup specific value from that table, I'd like to suggest write other variables to get current row contents, then use these variables as filter parameters on above table and use try to summary them with single value.

 

Sample:

 

Measure=
VAR _current = Table2[Type]
VAR temp =
    ADDCOLUMNS (
        SUMMARIZE (
            'Sample Upload File',
            'Sample Upload File'[Project Type],
            "Diff", [$Difference_final],
            "Balance Conversion", CALCULATE (
                SUM ( 'Non-Invoiceable CY by Project Type'[Balance Comparison] ),
                ALL ( 'Sample Upload File'[Project Type] )
            )
        ),
        "Result", IF ( ABS ( [Difference ] ) > [Balance], "Out", "Within" )
    )
RETURN
    MAXX ( FILTER ( temp, [Project Type] = _current ), [Result] )

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

8 REPLIES 8
motyagi
Helper I
Helper I

@Vvelarde Can you help me with this one as well?

I am trying to create a new table that would pull dat from here - 

Project Difference Balance
A42183149
B409813294
C10173559
D-2950

As mentioned Difference is a measure created with other fields so the new table doesnt have the same values Balance on the other end matches perfectly. 

 

I want to create a field that will mark A as out of threshold and i want to use this field to color the scatter plot dot for A as red and all the other projects and green. 

 

I created the new table using this  - 

Color = SUMMARIZE('Sample Upload File','Sample Upload File'[Project Type],
"Diff",[$Difference_final],"Balance Conversion",CALCULATE(SUM('Non-Invoiceable CY by Project Type'[Balance Comparison]),All('Sample Upload File'[Project Type])))

Vvelarde
Community Champion
Community Champion

@motyagi

 

You can add a new calculated column to this new table:

 

Column = IF(ABS(Table1[Difference ])>Table1[Balance];"Out";"Within")

Regards

Victor




Lima - Peru

But my problem is that when I pull the measure from the old table to a new table ( to fx this by project type) it gives me a different value 

 

HI @motyagi,

 

For your requirement ,you can use var function to store this summary table into measure formula.

 

If you need to lookup specific value from that table, I'd like to suggest write other variables to get current row contents, then use these variables as filter parameters on above table and use try to summary them with single value.

 

Sample:

 

Measure=
VAR _current = Table2[Type]
VAR temp =
    ADDCOLUMNS (
        SUMMARIZE (
            'Sample Upload File',
            'Sample Upload File'[Project Type],
            "Diff", [$Difference_final],
            "Balance Conversion", CALCULATE (
                SUM ( 'Non-Invoiceable CY by Project Type'[Balance Comparison] ),
                ALL ( 'Sample Upload File'[Project Type] )
            )
        ),
        "Result", IF ( ABS ( [Difference ] ) > [Balance], "Out", "Within" )
    )
RETURN
    MAXX ( FILTER ( temp, [Project Type] = _current ), [Result] )

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Vvelarde
Community Champion
Community Champion

@motyagi

 

Hi, Are columns? or have a measure?

 

 




Lima - Peru

Hi$Difference is a measure and balance conversion is a column so when I bring in the balance conversion it matches up but the measure doesn’t.
Vvelarde
Community Champion
Community Champion

@motyagi

 

Please post a sample to easily recreate this.

 

 




Lima - Peru

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.