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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Display diff values for diff rows

headingsub headingvalue
h1sub1 
h1sub2 

 

here need to display values under the value column but sub1 caluculation is diff and sub2 caluculation is diff.

i tried if(table[sub heading] = "sub1",[measure]) i tried this way but am not getting values, these values are coming from another table. how can i achieve it?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

"sub1 caluculation is diff and sub2 caluculation is diff" -- I have difficult to understand this part. Both the calculation of sub1 and sub2 are diff? What is this "diff"?

Just look at your measure, maybe you can try the following formula.

measure = switch(selectedvalue(sub heading),"sub1",[measure],"sub2",[measure2],...)

https://docs.microsoft.com/en-us/dax/switch-function-dax 

If I misunderstand your requirement, please share some sample data and expected result to us.

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

"sub1 caluculation is diff and sub2 caluculation is diff" -- I have difficult to understand this part. Both the calculation of sub1 and sub2 are diff? What is this "diff"?

Just look at your measure, maybe you can try the following formula.

measure = switch(selectedvalue(sub heading),"sub1",[measure],"sub2",[measure2],...)

https://docs.microsoft.com/en-us/dax/switch-function-dax 

If I misunderstand your requirement, please share some sample data and expected result to us.

 

Best Regards,

Jay

VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you add a sample of your data? It's hard now to understand your data Model.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

BTW, you can write codes like this:

 if(table[sub heading] = "sub1",[Measure 1], [Measure 2])

 

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

Appreciate your Kudos!!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.