MBR
MBR

Reputation: 33

Power BI DAX - reuse measures in resultset

I am new with DAX and Power BI. I have a Power BI resultset with an unique identifier (ID), a column (REF_ID) that references to the ID column, but is nullable, and a measure (MSR). Now I simply want to make a calculation: New_Measure = MSR (if REF_ID is NULL) New_Measure = MSR + MSR_REF_ID (so the MSR from the ID that is referencing from REF_ID).

Example: New_Measure(ID=3) = Measure(ID=3) + Measure(ID=6) = -5283619.953 + 1911594.57332966

Who can help???

enter image description here

Upvotes: 0

Views: 304

Answers (1)

Himanshu Agrawal
Himanshu Agrawal

Reputation: 271

Create a new column in Power BI using below formula:

New_Measure = IF(Ref_ID = BLANK(), MSR, MSR + LOOKUPVALUE(MSR, ID, REF_ID))

You can refer syntax for IF and LOOKUPVALUE for DAX

Upvotes: 0

Related Questions