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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Measure to only be applied for a specific row

I have written a measure and of course by default the measure will calculate based on the row context. Is there any way to basically make the measure only calculate for a specific row and then return 0 for the row which it does not correlate to?

 

For example the measure ROS #£M Web should only be calculated for ONLINE branches but because it is doing a row by row calculation it will do the same for 'IN STORE' when I actually need the 'IN STORE' to return 0 

joluwa_0-1696422090180.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous Try this .
ROS # £M Web = IF ( SELECTEDVALUE('Campaign Overview'[Type]) = "IN STORE", 0, ROUND ( DIVIDE ( SUM('Campaign Overview'[orders]), SUM('Campaign Overview'[salesPerMillion]) ), 2 ) )

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

@Anonymous Try this .
ROS # £M Web = IF ( SELECTEDVALUE('Campaign Overview'[Type]) = "IN STORE", 0, ROUND ( DIVIDE ( SUM('Campaign Overview'[orders]), SUM('Campaign Overview'[salesPerMillion]) ), 2 ) )

Anonymous
Not applicable

@Anonymous Try this .
ROS # £M Web = IF ( SELECTEDVALUE('Campaign Overview'[Type]) = "IN STORE", 0, ROUND ( DIVIDE ( SUM('Campaign Overview'[orders]), SUM('Campaign Overview'[salesPerMillion]) ), 2 ) )

Idrissshatila
Super User
Super User

HEllo @Anonymous ,

 

try this

ROS # £M Web =
    ROUND(
        DIVIDE (
        calculate(SUM('Campaign Overview'[orders]), branch_type = "ONLINE"),
        Calculate(SUM('Campaign Overview'[salesPerMillion]), branch_type = "ONLINE"),
        0
        )
    ,2
    )
 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

that returns 0.55 for both online and in store 

joluwa_0-1696429933216.png

because the code will apply the same for the instore reason why it cant be added within the code because the row context will still override it

Anonymous
Not applicable

Thanks for the response, that is similar to what I tried but when that happens it just repeats the same value for both like so:

joluwa_0-1696422912244.png

 

Hello @Anonymous ,

 

Can you show me your measure?

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

ROS # £M Web =
    ROUND(
        DIVIDE (
        SUM('Campaign Overview'[orders]),
        SUM('Campaign Overview'[salesPerMillion])
        )
    ,2
    )
 
This is the measure but I need it to return 0 for the row of 'IN STORE' but I cannot explicitly do that within the measure because it will just repeat the same value for both.
 
So the output i'm looking for is :
TypeROS #£ Web
IN STORE0
ONLINE0.55
Idrissshatila
Super User
Super User

Hello @Anonymous ,

 

yes sure try this

 

New measure =
var ONLINE = calculate ( "Add here the ROS #£M Web calculation " , branch_type = "ONLINE")
return

if ( ONLINE = blank(), 0, ONLINE)

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.