Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi, I need to exlude BLANK's from a calculation, but cant't find the righ way. I want to create a calculated column to be exact, MIN from two other column, but when one of them is blank, the whole calculation returns blank. How do I avoid that? Thx in advance!
Solved! Go to Solution.
Well this is kinda silly but here goes
Column =
IF (
ISBLANK ( Table1[Column1] + Table1[Column2] );
BLANK ();
IF (
ISBLANK ( Table1[Column1] );
Table1[Column2];
IF (
ISBLANK ( Table1[Column2] );
Table1[Column1];
IF ( Table1[Column1] <= Table1[Column2]; Table1[Column1]; Table1[Column2] )
)
)
)I realize this request is a couple years old, but I came here yesterday looking for the same answer and managed to come up with a solution that I was rather proud of so I thought I would share in case it helps somebody else in our situation. Many thanks to sqlbi.com for the guidance!
The idea is, you put your values into a column, and then grab the first (minimum) non-blank value using the FIRSTNONBLANK function. Simple!
Example:
FIRSTNONBLANK({[Value1],[Value2],[Value3]},1)
I needed to find the minimum value across 5 columns where a blank was possible but I needed blanks to be ignored. This solution and the FIRSTNONBLANK formula is exactly what I needed. Thanks for the example including the curly { } brakets.
Well this is kinda silly but here goes
Column =
IF (
ISBLANK ( Table1[Column1] + Table1[Column2] );
BLANK ();
IF (
ISBLANK ( Table1[Column1] );
Table1[Column2];
IF (
ISBLANK ( Table1[Column2] );
Table1[Column1];
IF ( Table1[Column1] <= Table1[Column2]; Table1[Column1]; Table1[Column2] )
)
)
)Could you put an example with more than 2 columns?
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.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |