Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hi All,
I am trying to do a SUM on column [Total Amount] when column [Promotion_id] is blank AND column [order_order_scr] = 1
My DAX for new column is;
NoOfferTotal = IF(AND(FORMAT([order_order_src] = 1,"String"), 'POS Data 1'[promotion_id] = " "),SUM('POS Data 1'[Total Amount]),0)
This errors and DAX comparison operations do not support values of string and integer.
Any help would be appreicated.
Solved! Go to Solution.
@v-jiascu-msft is right and it's a better solution in case that promition_id is actually "" in some cases.
revised codes:
measure =
CALCULATE(
SUM('POS Data 1'[Total Amount]),
'POS Data 1'[promotion_id] = BLANK(),
'POS Data 1'[order_order_src] = 1
)
column =
IF(
AND(
'POS Data 1'[promotion_id] = BLANK(),
'POS Data 1'[order_order_src] = 1
),
'POS Data 1'[Total Amount]
)
@Anonymous
Hi,
It seems that the answer is there. So I just give a suggestion that you can replace "" with BLANK(). "Format" isn't needed.
Best Regards!
Dale
@v-jiascu-msft is right and it's a better solution in case that promition_id is actually "" in some cases.
revised codes:
measure =
CALCULATE(
SUM('POS Data 1'[Total Amount]),
'POS Data 1'[promotion_id] = BLANK(),
'POS Data 1'[order_order_src] = 1
)
column =
IF(
AND(
'POS Data 1'[promotion_id] = BLANK(),
'POS Data 1'[order_order_src] = 1
),
'POS Data 1'[Total Amount]
)
Hi @Anonymous,
You can calculate this as a measure with this DAX code. I would however prefer to make the calculation a measure instead of a column unless you for some reason really need this as a column in your table.
NoOfferTotal =
CALCULATE(
SUM('POS Data 1'[Total Amount]),
FORMAT( 'POS Data 1'[promotion_id], "String" ) = "",
'POS Data 1'[order_order_src] = 1
)
If you really need it as a column - this code should do the trick:
IF(
AND(
FORMAT( 'POS Data 1'[promotion_id]; "String" ) = "",
'POS Data 1'[order_order_src] = 1
),
'POS Data 1'[Total Amount]
)
Hi @Anonymous
Can you please show a snapshot of some of the data so we can see what kind of values are in each column?
That will help reformat the query.
I'm mostly interested in the [order_order_src] column
Thanks for the replies.
Both column are whole numbers, see screen shots.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 49 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 122 | |
| 118 | |
| 38 | |
| 36 | |
| 29 |