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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Compare columns and show result in either

Hello, I have two visuals, both coming from the same table, the "Value" is a measure. The visuals are differently filtered based on the "Reporting category".

 

Screenshot 2023-06-01 094554.jpg

 

Now, I wish to compare "value" of account no "1000610" from visual 1 to the  "value" of account no "200610" + "value" of account no "200830" from visual 2. 

And based on the comparision, I wish to find which value is bigger and show the difference on either of the visual where the value was bigger. 

consequently "100610" in visual 1 , "200610" and "200830" in visual 2 should not show up. Only the difference should show as "ABC" under either "OTHERASSETS" or "LIABLITIES", based on which had the bigger value.

 

I hope I am able to explain my issue.

@Greg_Deckler @lbendlin @amitchandak 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Here I create a sample to have a test.

vrzhoumsft_0-1685950102289.png

Measure:

Diff = 
VAR _VISUAL1 =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reporting Category] = "OTHERASSETS"
                && 'Table'[Level2] = 100610
        )
    )
VAR _VISUAL2 =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reporting Category] = "LIABILITIES"
                && 'Table'[Level2] IN { 200610, 200830 }
        )
    )
RETURN
    _VISUAL1 - _VISUAL2
Card = 
SWITCH (
    TRUE (),
    [Diff] < 0, "Visual 2 200610 and 200830 bigger",
    [Diff] > 0, "Visual 1 100610 bigger",
    "Two visual the same"
) 
Value without 100610/200610/200830 = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', NOT ( 'Table'[Level2] IN { 100610, 200610, 200830 } ) )
)

I suggest you to show the result of comparsion in card visual.

vrzhoumsft_1-1685950173106.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Here I create a sample to have a test.

vrzhoumsft_0-1685950102289.png

Measure:

Diff = 
VAR _VISUAL1 =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reporting Category] = "OTHERASSETS"
                && 'Table'[Level2] = 100610
        )
    )
VAR _VISUAL2 =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Reporting Category] = "LIABILITIES"
                && 'Table'[Level2] IN { 200610, 200830 }
        )
    )
RETURN
    _VISUAL1 - _VISUAL2
Card = 
SWITCH (
    TRUE (),
    [Diff] < 0, "Visual 2 200610 and 200830 bigger",
    [Diff] > 0, "Visual 1 100610 bigger",
    "Two visual the same"
) 
Value without 100610/200610/200830 = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', NOT ( 'Table'[Level2] IN { 100610, 200610, 200830 } ) )
)

I suggest you to show the result of comparsion in card visual.

vrzhoumsft_1-1685950173106.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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