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
dtartaglia
Resolver I
Resolver I

DAX if statement using a measure to display a status

Hi,

 

I cannot seem to get this to work. I'm trying to create a column in my table that displays a status depending on a values from a column and measure. vwRevitDocumentSession[DocumentSessionDurationMin] is coming from a database and vwRevitEvent[Number of Synchs] is a measue:

 

Number of Synchs = CALCULATE(COUNTROWS(vwRevitEvent), vwRevitEvent[RevitEventName] = "DocumentSynchronization")

 

The below statement seems to blank all values for: vwRevitEvent[Number of Synchs]

 

Num Sync Status = IF(VALUES(vwRevitDocumentSession[DocumentSessionDurationMin]) / VALUES(vwRevitEvent[Number of Synchs]) > 60, "Bad", "Good")

 

...I'm just looking to display a status value to show if my IF meets recommended.

 

test.JPG

Thanks,

Dan

 

7 REPLIES 7
parry2k
Super User
Super User

Why you are using value function?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi,

 

What should I use? I'm drawing a blank getting this to work. I have to evaluate each row value and I'm in DirectQuery mode. Tried a number of things.

 

Thanks,

Dan

 

Hi @dtartaglia,

Your measure "Num Sync Status " return all blank, rather than Good or Bad, right? Could you please share your sample data for further analysis? Based on my understanding, the "Number of Synchs" measure will count all the row where  vwRevitEvent[RevitEventName] = "DocumentSynchronization", the result shoud be one rather than mutiple.

 

Best Regards,
Angelia

Hi,

 

Your right, 'Number of Synchs' is reducing the number of rows in the table and my 'status' is trying to process by row (sorry, I didn't think about that before posting). I'm not sure I can do the 'status' then.

 

Dan

Hi @dtartaglia

There are relationship between 'vwRevitDocumentSession' and 'vwRevitEvent' tables, right? If it is, you can create a calculated column in 'vwRevitDocumentSession' table to get your result.

 

Num Sync Status = IF((vwRevitDocumentSession[DocumentSessionDurationMin] / vwRevitEvent[Number of Synchs]) > 60, "Bad", "Good")

 

If this is what you want, could you please share the sample data or .pbix file for further analysis.

 

Best Regards,
Aneglia

Hi Aneglia,

 

'Number of Syncs' is a calculated mesuase, If I use your example, vwRevitEvent[Number of Synchs] cannot be found in the DAX statement. I will attempt to post some of the data but it is all coming from a large private SQL db.

 

Thanks,

Dan

Hi @dtartaglia

Please verify there is relationship between 'vwRevitEvent' and 'vwRevitDocumentSession'. I understand you all data come from a large private SQL db. You'd better create sample similar table by yourself.

 

Best Regards,
Angelia

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.