If Condition

0 votes
if [Dollars paid]<SUM([Claim_line].[Allowed_Amount_B6]) then 'Dollars lost'
elseif [Dollars paid]>SUM([Claim_line].[Allowed_Amount_B6]) then 'Accounts Received'
else 'Outstanding Receivables'
END  --- this Tableau Calculation.

please above calculation how to write the Dax Calculation in power bi?
Aug 20 in Power BI by vnk
29 views
Is [Claim_line].[Allowed_Amount_B6] one field or do you want to multiply them?

1 answer to this question.

0 votes
DAX - I assume [Claim_line].[Allowed_Amount_B6] is one column.

if(table_name[Dollars paid]<SUM(table_name[Claim_line].[Allowed_Amount_B6]) ,'Dollars lost',
if(table_name[Dollars paid]>SUM(table_name[Claim_line].[Allowed_Amount_B6]),'Accounts Received','Outstanding Receivables'))
answered Aug 20 by anonymous
• 25,660 points
TableA= SUM(Paid), SUM(Patient Respons Amount)

TableB= SUM(Allowed Paid)

i written dax - measure calculation get solution but i need filter level measure calculation it is not working.

Actually these are two fields P=Paid+Unpaid and Allowed Paid

Allowed Paid=p then "Paid"
Allowed Paid<P then "Under"
Allowed Paid>P then "Over"

how to write DAX Calculation in Column or Measure? please detail? below example:

Allowed Paid  p(Paid+Patient Respons amount)

120                      20+30(50) = 120<50=Under

150                     130+100(230) = 150>230 =Over

200                     140+60(200)=200=200= Paid             finally_Filter(Paid,Under,Over)

Hi, Vnk. Check out the solution below.

If you want to add = 7 to Under or Over, then add as below. Depending on whether =7 be assigned to Under or Over.

IF([Table name][Allowed Paid] <=p,"Under","Over") 
#or
IF([Table name][Allowed Paid] <p,"Under","Over")

Else check for =7 condition using nested if.

IF([Table name][Allowed Paid] <p,"Under",IF([Table name][Allowed Paid] >p,"Over","Equal to 7"))

Hope it helps! 

Revert back if any problems.

PS: Do Signup to the community, it will help you get email notifications and keep you updated with new discussions on the Community :)

Hi Vnk,

Dax would work if p is a column. Then you can use the below DAX itself.

IF([Table name][Allowed Paid] <p,"Under",IF([Table name][Allowed Paid] >p,"Over","Paid"))

As per your example, p value changes for each row, So it should be a column and not a measure. Change p to a column and try again.

Hope you understood.

PS: Do Signup to the community, it will help you get email notifications and keep you updated with new discussions on the Community :)

Related Questions In Power BI

0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 22 in Power BI by VNK
7,446 views
0 votes
1 answer

Distinct count filtered by condition using Power BI Dax

Try this, it should work: DistinctCountActiveMonths = CALCULATE( ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 40,440 points
6,078 views
0 votes
1 answer

Count - using If within period of dates.

Hi Sindhu, Use below DAX code to create ...READ MORE

answered May 8 in Power BI by Cherukuri
• 25,660 points
29 views
+1 vote
2 answers

If and Else Statement to use in operator

Hey @Megha. I am new to Power BI ...READ MORE

answered Aug 29 in Power BI by anonymous
• 25,660 points
25 views
0 votes
0 answers

Assume referential integrity

1) What is Assume referential integrity? what ...READ MORE

Aug 19 in Power BI by vnk
9 views
0 votes
1 answer

How to export data to CSV from power bi embedded url ?

Hi Arathi, You can open Visuals from embedded ...READ MORE

answered Aug 23 in Power BI by anonymous
• 25,660 points
26 views
0 votes
0 answers

Power Bi to Machine Learning Model

Hi Team, i would like to asking Power ...READ MORE

6 days ago in Power BI by vnk
22 views
+2 votes
1 answer

How to compare 2 comna separated strings in informatica?

A java transformation can be used to ...READ MORE

answered Aug 17 in Others by Rojalin
• 200 points
40 views
0 votes
1 answer

add bar colors in power bi under condition

Hi Sindhu, Follow below steps to add colors ...READ MORE

answered Apr 8 in Power BI by Cherukuri
• 25,660 points
17 views
0 votes
1 answer

calculation with condition and filter

Hi Preethi, Follow the below steps: 1. Create a ...READ MORE

answered May 2 in Power BI by Cherukuri
• 25,660 points
25 views