As a measure, you could do something like below. I'm assuming that you have a model as follows:

  • Fact: (Date, ID, Value)
  • DimDate: (Date, ...)
  • Rates: (ID, Rate)
  • Dim: (ID, ...)

With these tables you'd have relationships as below:

  • Dim -1:N-> Fact
  • Dim <-1:1-> Rates
  • DimDate -1:N-> Fact

With the model above, you could then build a visual of:

  • Rows: DimDate[Date]
  • Columns: Dim[ID]
  • Values: [Value Or Rate Measure]
Value = SUM ( 'Fact'[Value] )
Rate = SUM ( 'Rates'[Rate] )
Value Or Rate Measure =
VAR Value = [Value]
RETURN
  IF ( ISBLANK ( Value ), [Rate], Value )

This might not do what you want for totals - you didn't specify. So if you need visual totals you might try the following:

Value or Rate - visual totals =
SUMX (
  CROSSJOIN ( VALUES ( 'Dim'[ID] ), VALUES ( 'DimDate'[Date] ) ),
  [Value Or Rate Measure]
)

You could also handle this in Power Query M, assuming you have the same tables I've described above. I'm assuming each table has an associated query of the same name.

let
    Source = Table.AddColumn(Dim, "Date", each DimDate[Date]),
    #"Expanded Date" = Table.ExpandListColumn(Source, "Date"),
    #"Merged Queries" = Table.NestedJoin(#"Expanded Date", {"id", "Date"}, Fact, {"ID", "Date"}, "Fact", JoinKind.LeftOuter),
    #"Expanded Fact" = Table.ExpandTableColumn(#"Merged Queries", "Fact", {"Value"}, {"Value"}),
    #"Merged Queries1" = Table.NestedJoin(#"Expanded Fact", {"id"}, Rates, {"ID"}, "Rates", JoinKind.LeftOuter),
    #"Expanded Rates" = Table.ExpandTableColumn(#"Merged Queries1", "Rates", {"Rate"}, {"Rate"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Rates", "Value Or Rate", each if [Value] = null then [Rate] else [Value]),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Value", "Rate"})
in
    #"Removed Columns"

Here, we're doing something similar, but at a table level, instead of as a measure. We crossjoin Dim[ID] and DimDate[Date] to get a dense table of all date and ID combinations. Then we left join the original Fact table and the Rates table. Then we add a column that takes [Value] if it exists, or [Rate] if [Value] is null.

Answer from greggyb on Stack Overflow
Top answer
1 of 1
1

As a measure, you could do something like below. I'm assuming that you have a model as follows:

  • Fact: (Date, ID, Value)
  • DimDate: (Date, ...)
  • Rates: (ID, Rate)
  • Dim: (ID, ...)

With these tables you'd have relationships as below:

  • Dim -1:N-> Fact
  • Dim <-1:1-> Rates
  • DimDate -1:N-> Fact

With the model above, you could then build a visual of:

  • Rows: DimDate[Date]
  • Columns: Dim[ID]
  • Values: [Value Or Rate Measure]
Value = SUM ( 'Fact'[Value] )
Rate = SUM ( 'Rates'[Rate] )
Value Or Rate Measure =
VAR Value = [Value]
RETURN
  IF ( ISBLANK ( Value ), [Rate], Value )

This might not do what you want for totals - you didn't specify. So if you need visual totals you might try the following:

Value or Rate - visual totals =
SUMX (
  CROSSJOIN ( VALUES ( 'Dim'[ID] ), VALUES ( 'DimDate'[Date] ) ),
  [Value Or Rate Measure]
)

You could also handle this in Power Query M, assuming you have the same tables I've described above. I'm assuming each table has an associated query of the same name.

let
    Source = Table.AddColumn(Dim, "Date", each DimDate[Date]),
    #"Expanded Date" = Table.ExpandListColumn(Source, "Date"),
    #"Merged Queries" = Table.NestedJoin(#"Expanded Date", {"id", "Date"}, Fact, {"ID", "Date"}, "Fact", JoinKind.LeftOuter),
    #"Expanded Fact" = Table.ExpandTableColumn(#"Merged Queries", "Fact", {"Value"}, {"Value"}),
    #"Merged Queries1" = Table.NestedJoin(#"Expanded Fact", {"id"}, Rates, {"ID"}, "Rates", JoinKind.LeftOuter),
    #"Expanded Rates" = Table.ExpandTableColumn(#"Merged Queries1", "Rates", {"Rate"}, {"Rate"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Rates", "Value Or Rate", each if [Value] = null then [Rate] else [Value]),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Value", "Rate"})
in
    #"Removed Columns"

Here, we're doing something similar, but at a table level, instead of as a measure. We crossjoin Dim[ID] and DimDate[Date] to get a dense table of all date and ID combinations. Then we left join the original Fact table and the Rates table. Then we add a column that takes [Value] if it exists, or [Rate] if [Value] is null.

🌐
Reddit
reddit.com › r/powerbi › measure to return text if error or if blank?
r/PowerBI on Reddit: Measure to return text if error or if blank?
July 18, 2023 -

I use a measure to populate a card visual. Im calling out top 3 locations per another measure. and because you cant filter cards with a measure, I need to filter the measure.

=filter(all('table'[location], [rank measure]=1)

This works great for single results. But sometimes locations, because I am using SKIP in my ranking, I have multiples and some none at all.

Example of how my ranking looks:

LocationRank
A1
C1
F3
D4

So I have two 1st place and no second place. Thats the way I want the ranking to show. So my cards show an error for Rank 1 and BLANK for Rank 2.

I can do an IFERROR, which solves for errors, but not blanks. I can use ISBLANK() but then I will still get the error.

Is there any way to do this? I want the measure to return "Tie, See Table" if there is an error or the result is BLANK. I have tried nesting them both ways, but the error always wins out.

🌐
Statology
statology.org › home › power bi: how to replace blank with text
Power BI: How to Replace Blank with Text
December 12, 2023 - You can use the following syntax in DAX to replace blank values with specific text in a particular column of a table in Power BI: Team_New = IF(ISBLANK('my_data'[Team]), "None Found", 'my_data'[Team])
🌐
Microsoft Fabric Community
community.fabric.microsoft.com › t5 › Desktop › Text-value-if-calculate-DAX-output-is-blank › td-p › 3016788
Text value if calculate DAX output is blank - Microsoft Fabric Community
January 12, 2023 - Measure = IF(ISBLANK(CALCULATE( SUM('Table' [COUNT]), 'Date DIM Table' [Today] IN { TRUE } ), "No Data", CALCULATE( SUM('Table' [COUNT]), 'Date DIM Table' [Today] IN { TRUE } ) ... Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! ... Check out the October 2025 Power BI update to learn about new features.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dax › isblank-function-dax
ISBLANK function (DAX) - DAX | Microsoft Learn
//Sales to Previous Year Ratio = IF( ISBLANK('CalculatedMeasures'[PreviousYearTotalSales]) , BLANK() , ( 'CalculatedMeasures'[Total Sales]-'CalculatedMeasures'[PreviousYearTotalSales] ) /'CalculatedMeasures'[PreviousYearTotalSales])
🌐
DAX Guide
dax.guide › isnontext
ISNONTEXT – DAX Guide
November 5, 2025 - When applied to a column reference as expression, this functions tests the data type of the column, returning FALSE if the column is a string, and TRUE for any other data type. An empty string is considered text. These two expression returns the same result. ISNONTEXT ( <value> ) NOT ISTEXT ...
Find elsewhere
🌐
Microsoft Community
community.fabric.microsoft.com › t5 › DAX-Commands-and-Tips › If-row-is-empty-then-text › td-p › 2711862
Solved: If row is empty then text - Microsoft Fabric Community
August 23, 2022 - Thank you very much. 🙂 Best Regards Jannis · Solved! Go to Solution. ... You can write an if statement to compare with the current value to replace if the current value equal to blank.
🌐
SPGuides
spguides.com › power-bi-if
Power BI If Statement | If Contains Power BI
March 26, 2025 - You want to use Power BI to filter out products whose prices fall between $20 and $50. According to this scenario, we have an Excel file named Sales Data. ... 2. Under the “Modeling” tab and click on “New column”. We’ll create a measure to identify products whose prices fall within our specified range. 3. In the formula bar, put the below expression. Then Click the Commit button. Price Range = IF('SalesData'[Price] >= 20 && 'SalesData'[Price] <= 50, "Within Range", "Out of Range")
🌐
Microsoft Fabric Community
community.fabric.microsoft.com › t5 › Desktop › Check-if-a-column-values-is-blank-and-simply-return-Yes-N › td-p › 1984043
Solved: Check if a column values is blank and simply retur... - Microsoft Fabric Community
July 30, 2021 - I have built a simple data sample(column is Text type), please check. ... Best Regards, Eyelyn Qin If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. ... Thank you for your feedback. What I wrote is for calculated column, written in DAX. ... If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
🌐
MrExcel
mrexcel.com › forums › question forums › power tools
If Function in Power Query and blank Cells | MrExcel Message Board
December 2, 2016 - In "M," how do I write an If function with a blank cell: =if [Country] = "" then [Location] else [Country] It is not working...probably having to do with testing if a cell is blank. Please help. Thank you!
🌐
Microsoft Community
community.fabric.microsoft.com › t5 › Power-Query › Custom-Column-with-isblank-and-isnotblank › td-p › 2100262
Custom Column with isblank and isnotblank - Microsoft Fabric Community
September 29, 2021 - New Column = SWITCH ( TRUE (), ... <> BLANK (), "Outcome3" ) Best Regards, Eyelyn Qin If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. ... Here is a column expression that should work. ... Did I answer your question? Mark my post as a solution! Kudos are also appreciated! To learn more about Power BI, follow me ...
🌐
Microsoft Fabric Community
community.fabric.microsoft.com › t5 › Desktop › DAX-If-value-is-blank-then-put-value-else-put-value › m-p › 786053
Solved: DAX-If value is blank then put value else put valu... - Microsoft Fabric Community
September 10, 2019 - Is this possible in Power BI with DAX? EX:( IF value is blank based on this date and ID, Value, Value) Solved! Go to Solution. ... @Anonymous I found the answer from someone on stack overflow. I am giving them all the credit. https://stackoverflow.com/a/57857461/11803142 ... Hi there, i think you are looking for some conditional formula. Something like: IF(AND(ID>0,Date>0), sum(ID1),sum(ID2))
🌐
SQLBI
sqlbi.com › articles › how-to-return-blank-instead-of-zero
How to return BLANK instead of zero - SQLBI
March 22, 2022 - This article describes how to return BLANK instead of zero in a DAX measure. Using this technique, you can remove rows in a Power BI matrix visual where the result of a measure is zero.
🌐
Reddit
reddit.com › r/powerbi › friday tip: change (blank) to 0 rapidly
r/PowerBI on Reddit: Friday Tip: Change (Blank) to 0 rapidly
October 7, 2022 -

We can agree (Blank) is super ugly to see on a report cause it just looks broken. but Zero....0000000 looks so good.

I use it as my simple trick that took too long to learn example when talking with over PowerBI developers and inevitably someone in the group facepalms when they realize it was that simple all along.

To do this is at the end of any measure / new column code etc, just add "+0" without quotations to the end of the code line and rejoice should show 0 now.

Measure = COUNT(<column>)

If there is no value in the above they will show (Blank) by default because adding nothing of no type is just that blank.

Measure = COUNT(<column>) +0

This +0 changes things to a math equation which provides a minimum value of 0.

Hope this helps someone and happy Friday.

🌐
RADACAD
radacad.com › home › radacad blog › replace blank with zero in power bi visuals such as card
Replace BLANK with Zero in Power BI Visuals Such as Card - RADACAD
February 5, 2020 - The problem is that if I select a year such as 2010, I get the SalesAmount as Blank: So, what is the solution? really simple. using a DAX measure. let’s see. One easy way to replace the (Blank) with zero or anything else, is to use a measure. You can create a measure in the Modeling tab; Then write the DAX expression of the measure like this:
🌐
DAX Guide
dax.guide › blank
BLANK – DAX Guide
1 week ago - This article describes how to return BLANK instead of zero in a DAX measure. Using this technique, you can remove rows in a Power BI matrix visual where the result of a measure is zero.
🌐
Microsoft Fabric Community
community.fabric.microsoft.com › t5 › Desktop › IF-ISBLANK-Return-Blank › m-p › 538585
IF ISBLANK Return Blank - Microsoft Power BI Community
October 10, 2018 - Solved: Hi guys, Basically, if Date2 is blank then Age column should be blank because there is nothing to compare to. DaysBetweenDates =