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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
sreekanths
Regular Visitor

Calculating value based on another value in same visual

Hi,

Is it possible to change the values in only selected rows in a table based on a slicer selection?

 

Values in Total Count, Acutal Value and Project Value are obtained from Measures.

 

My data when all values are selected in sub category slicer is 

DataTotal CountActual valueProjected value
A1005560
B1005560

 

On choosing values from the sub category slicer, the table has to changes as below. The "A" row remains unchanged, but "B" row value changes.

 

DataTotal CountActual valueProjected value
A1005560
B954543

 

The values in Data column is obtained from a disconnected table.

1 ACCEPTED SOLUTION

Hi , @mahoneypat 

Is the expected result you provided wrong?

Is this your real expected result?

8.png

Please check if the following measure helps.

 

Compare_Total Actual value = 
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table 3'[Data] ) = "A", 'Table 1'[Total Actual_value],
    SELECTEDVALUE ( 'Table 3'[Data] ) = "B", 'Table 1'[S_Total Actual_value]
)

 

.....

Here is a sample pbix attached.

 

Best Regards,
Community Support Team _ Eason
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

5 REPLIES 5
amitchandak
Super User
Super User

@sreekanths , We need more information on data. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Input data

productProject valueActual valuesub categoryCount
11215x20
21312x20
3125y20
4115y20
51218z20

 

Data
A
B

 

Default view on pbix - no selection on sub-categories filter

DataTotal CountActual valueProjected value
A1005560
B1005560

 

Expected output on choosing Sub Category values x and z

 

DataTotal CountActual valueProjected value
A1005560
B1004543

Hi , @mahoneypat 

Is the expected result you provided wrong?

Is this your real expected result?

8.png

Please check if the following measure helps.

 

Compare_Total Actual value = 
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table 3'[Data] ) = "A", 'Table 1'[Total Actual_value],
    SELECTEDVALUE ( 'Table 3'[Data] ) = "B", 'Table 1'[S_Total Actual_value]
)

 

.....

Here is a sample pbix attached.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

Not totally clear on what your goal is, but you can have row dependent logic with an approach like this

 

NewMeasure = if(selectedvalue(Table1[ColumnInVisual])=selectedvalue(DisconnectedTable[Value]), [MeasureForBRow], [MeasureForOtherRows])

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Can you please explain which table you are referring to in your expression - NewMeasure = if(selectedvalue(Table1[ColumnInVisual])=selectedvalue(DisconnectedTable[Value]), [MeasureForBRow], [MeasureForOtherRows])

 

I am getting Data from one table and all other values from another table.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.