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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
fzins
Frequent Visitor

Measure to show field based on another field

I have a tabular Visual with 2 fields.

Field A from table A shows the 'Status' and field B from table B shows the 'Code'.

I want to show the code only when Status='Denied'. Otherwise it should be blank.

I successfully implemented this with conditional formatting, but when the report is downloaded it'll show the code by all statuses.

 

How can I create this using a measure?

5 REPLIES 5
fzins
Frequent Visitor

Thank you for that. I changed the relationship to one to many and created the measure. However, my table now shows only 'Denied' records. 

The measure somehow filters my data to 'Denied'.

Any advice?

Would it be possible to re-create the scenario with sample data in a sample .pbix file then upload it somewhere and provide a link?

 

Failing that, the only suggestion I have is to make sure that in your table visual, the 'ClaimID' column has "Show Items with no data" selected, like this:

nodata.PNG

 

fzins
Frequent Visitor

Thank you for taking the time to respond.

My two tables are joined with a one to one relationship of tblClaims.ClaimID to qryERA_PBI.ClaimID

fzins_0-1716569417429.png

 

TblClaims.ClaimStatus has values such as 'denied', ;paid' , 'claim in process', 'claim submitted' and qryERA has all denied claims (ClaimID) where Status is 'Denied' or  'Paid'

 

Hope this helps

okay so I recreated your problem with these two tables:

 

TblDocrite.ClaimStatus

tablea.PNG

 

qryERA 

tableb.PNG

 

But I changed the relationship to many to one, with single-direction cross filtering, from TblDocrite to qryERA.

 

model.PNG

 

 

Then I made this table

 

result.PNG

Using TblDocrite.ClaimStatus[ClaimID], TblDocrite.ClaimStatus[Status], and the following measure:

 

Code_Measure =
var claimstatus = SELECTEDVALUE('TblDocrite ClaimStatus'[Status])
var code = max(qryERA[Code])
return
IF (claimstatus = "denied", code, BLANK())

 

 

See attached .pbix file with a working solution.

 

///Mediocre Power BI Advice, but it's free///

kpost
Super User
Super User

Can you upload sample data for the two tables, tell us about any active relationship(s) between the two tables in your data model, and/or a .pbix file containing the problem (ideal)?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.