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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors