We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello guys,
I would like to use same function IF like in Excel.
Table - is already calculated field and it's live source. I have 2 columns: Plan, Actual. I want to create measure that will shows me values like this: IF(Actual>1;1;Actual). But in power bi will give me value 1 everywhere, even in Total, because totals here is calculated field too, that used same formula, instead of sum by column. How can i solve it?
| Plan | Actual | Corrected | |
| 1 | 1 | 1 | |
| 1 | 1 | 1 | |
| 1 | 2 | 1 | |
| 1 | |||
| 1 | 5 | 1 | |
| 1 | 1 | 1 | |
| 1 | 1 | 1 | |
| 1 | 3 | 1 | |
| 1 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| Total | 14 | 14 | 7 |
if Corrected is already a calculated column, wouldn't simple SUM measure do OK?
CorrectedValue = SUM('Table'[Corrected])
Please note it's a new Measure not a new column
Can you create calculated column in this table with the IF syntax you posted? and then apply the calculated measure?
Hi @Stachu
No i can't as it's live data. The easiest way is to ask admin to add new column with my function.
Hi @idontexist,
In addition, could you try using SUMX function to create a new measure to see if it works in your scenario? ![]()
Measure = sumx(Table1, IF(Actual>1;1;Actual))
Or
Measure = sumx(Table1,[Corrected])
Regards
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |