Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a SQL formula from SQL Developer that i'm trying to translate into DAX measure formula. Its taking orders from a fact table that status key = (25,133) then from another fact table with a filter and finally if true then sum the price from the third table.
Here is the formula i have from SQL Developer:
Sum( case when ODS_OWNER.FACT_FULFILLMENT.FULFILLED_STATUS_KEY in(25,133) then (
case when (DECODE(BITAND(ODS_OWNER.FACT_ORDER_LINE.ORDER_LINE_FLG, POWER(2 , 0)),POWER(2 , 0), '1', '0')) = 1 then 0
else ODS_OWNER.FCT_SHIP_GRP_ITEM.FULFILLMENT_ITEM_PRICE
END) else 0 end )That is some really deep PLSQL...
Bitand(ods_owner.fact_order_line.order_line_flg, Power(2, 0))
Isn't that just checking if fact_order_line_flg is an odd number? You can use the MOD function for that. The equivalent for Decode seems to be COALESCE()
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |