Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cchp07
Frequent Visitor

DAX-If value is blank then put value else put value

I am trying to create a measure that would look at a matrix that has dates for the rows and ID's for the columns and for the value, it is a measure that summed the max of another value based on the date and ID, but for some dates and ID's there are 0's and I want them to show the value instead(max of another value based on the date and ID). 

Is this possible in Power BI with DAX?

Capture.PNG

EX:( IF value is blank based on this date and ID, Value, Value)

 

 

1 ACCEPTED SOLUTION

@Anonymous  I found the answer from someone on stack overflow. I am giving them all the credit. 

https://stackoverflow.com/a/57857461/11803142

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi there, i think you are looking for some conditional formula.  Something like:

IF(AND(ID>0,Date>0), sum(ID1),sum(ID2))

 

I didn't check the syntax exactly but hope that helps.

@Anonymous  

 

Thanks for the tip, but it is more if the value is 0 then change it to that actually value otherwise leave the value compared to ID and Date.

 

If that makes sense. 

Anonymous
Not applicable

Hi there, i think you can accomplish the same with the DAX i provided?  Happy to help if you give some sample data with expected results.

@Anonymous  This a better representation that we are looking at.  Notice the snippets below. 


This snippet displays the chart we are looking at and it has blanks. Instead of blanks for those dates and ID's we want to show those values are; however, the values(Rates) may not be the same for every ID or Date. (This may happen on rare occasions.) Capture.PNG

This snippet displays the data being pulled into Power BI from excel (Just sample data). Notice that all the dates are in order but notice that some of the ID's do not have entries for certain dates. 

Capture1.PNG

I want to be able to say IF(ID is blank per this date, then put Value(Rate) that is attached to this ID)

 

This may not be possible to do in Power BI. We have an excel spreadsheet with similar data doing what we want but we wanted to automate by using Power BI. 

 

Thanks, 

 

Any Thoughts? 

Anonymous
Not applicable

@cchp07  which function you are using while filtering the data in Excel? Am also trying to find the solution on this using PowerBI.

@Anonymous  I found the answer from someone on stack overflow. I am giving them all the credit. 

https://stackoverflow.com/a/57857461/11803142

Anonymous
Not applicable

That IF, THEN logic is what i had proposed lol.  Glad you had got it to work.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.