Forum Discussion
TexasStone
1 year agoFrequent Visitor
Create Virtual Flag in Data with DAX Measure
This is something that is super easy to do with a calculated column, but I'm not sure how to implement the measure version in a live connection. I can pull data into a table visual from the serv...
Sahir_Maharaj
1 year agoSuper User
Hello TexasStone,
Can you please try this approach:
RevenueMeasure =
VAR OrdersWithABC =
CALCULATETABLE (
VALUES ( Orders[Order Number] ),
FILTER ( Orders, Orders[Product Name] = "ABC" )
)
RETURN
IF (
SELECTEDVALUE ( Orders[Order Number] ) IN OrdersWithABC,
[Revenue]
)
If you find that some products still do not appear, modify it slightly:
RevenueMeasure =
VAR OrdersWithABC =
CALCULATETABLE (
VALUES ( Orders[Order Number] ),
FILTER ( Orders, Orders[Product Name] = "ABC" )
)
RETURN
CALCULATE (
[Revenue],
Orders[Order Number] IN OrdersWithABC,
ALL ( Orders[Product Name] )
)
TexasStone
1 year agoFrequent Visitor
Both of these don't work. I'm not sure if it makes a difference, but it looks like you assumed everything lives in the Orders table but it does not. The Order Numbers live in the order table but the Products live in the Product Table.
Want to reiterate this is a live connection. I can do this super easily if importing the data.