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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Calvin69
Helper III
Helper III

True or False based on multiple Variables

Hi all,

I am trying to create a new column: "Status"

Data sample:

DatePropertyBuildingLocationClientStartEnd Break DateValueStatus
01/01/2021Prop1Build1Upper FlatVacant   £0.00 
01/01/2021Prop1Build1Upper FlatMC01/01/202131/12/202101/08/2021£20,000.00 
19/08/2021Prop1Build1Upper FlatMC01/01/202131/12/202101/09/2021£20,000.00TRUE
02/09/2021Prop1Build1Upper FlatMC01/01/202131/12/2021 £20,000.00TRUE
03/03/2023Prop1Build1Upper FlatMC01/01/202231/12/202201/06/2022£20,000.00TRUE
01/01/2023Prop1Build1Upper FlatFive Guys01/01/202331/12/202301/06/2023£25,000.00FALSE
02/06/2023Prop1Build1Upper FlatFive Guys01/01/202331/12/2023 £25,000.00TRUE
01/01/2024Prop1Build1Upper FlatFive Guys01/01/202431/12/202401/06/2024£25,000.00TRUE
01/01/2025Prop1Build1Upper FlatAddida   £25,000.00FALSE

 

Screenshot:

Calvin69_0-1630345553527.png

 

Logic:

  • If a break date for a location changes to future date or becomes "blank" and the client remains the same, status should be = True
  • If a break date for a location changes to a future date or becomes "Blank" and the client is different, Status should be = False

 

Obvisouly, this table will have multiple properties, multiple buildings and multiple locations.

 

Thanks in advance for your help

H

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Calvin69 ;

You could try to create a column by dax :

Status =
IF (
    [Client] = "Vacant"
        || ([Break Date] < TODAY ()&& [Break Date] <> BLANK ()),
    BLANK (),
    IF (
        [Break Date]= CALCULATE ( MIN ( [Break Date] ), ALLEXCEPT ( 'Table', 'Table'[Client] ) ),
        "False",
        "True"))

The final output is shown below:

vyalanwumsft_0-1630561284699.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @Calvin69 ;

You could try to create a column by dax :

Status =
IF (
    [Client] = "Vacant"
        || ([Break Date] < TODAY ()&& [Break Date] <> BLANK ()),
    BLANK (),
    IF (
        [Break Date]= CALCULATE ( MIN ( [Break Date] ), ALLEXCEPT ( 'Table', 'Table'[Client] ) ),
        "False",
        "True"))

The final output is shown below:

vyalanwumsft_0-1630561284699.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Calvin69
Helper III
Helper III

Hi @amitchandak ,

Would you be able to assist with this query?

Thanks

H

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Calvin69 

 

If a break date for a location changes to future date Means break date > Today or > [Date]? And you want a DAX calculated column or Power Query? Here is one way in Power Query, and use > [Date]

 

    #"Added Index" = Table.AddIndexColumn(yourPreviousStep, "Index", 0, 1, Int64.Type),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Status", each ([Break Date]>[Date] or [Break Date]=null ) and [Client]=#"Added Index"[Client]{[Index]-1})

Hi @Vera_33 ,

Thanks for your response, I really appreciate it.

 

Unfortunately, following the logic you mentioned above does not really provide me with what I am after as your proposed index column, indexes the whole data set under one sequence while in fact the index should be indexing entries per Client "for each client it restart numbering from 0 to Infinite".

 

I have managed to create successfully an index column "Using Dax" that does the indexing per Client however, I was not able to create a index like "Index Required".. Shown below..

 

Data sample:

DatePropertyBuildingLocationClient IndexClientIndex requiredStartEnd Break DateValueStatus
01/01/2021Prop1Build1Upper Flat1Vacant1   £0.00 
01/01/2021Prop1Build1Upper Flat1MC101/01/202131/12/202101/08/2021£20,000.00 
19/08/2021Prop1Build1Upper Flat1MC201/01/202131/12/202101/09/2021£20,000.00TRUE
02/09/2021Prop1Build1Upper Flat1MC301/01/202131/12/2021 £20,000.00TRUE
03/03/2023Prop1Build1Upper Flat1MC401/01/202231/12/202201/06/2022£20,000.00TRUE
01/01/2023Prop1Build1Upper Flat2Five Guys101/01/202331/12/202301/06/2023£25,000.00FALSE
02/06/2023Prop1Build1Upper Flat2Five Guys201/01/202331/12/2023 £25,000.00TRUE
01/01/2024Prop1Build1Upper Flat2Five Guys301/01/202431/12/202401/06/2024£25,000.00TRUE
01/01/2025Prop1Build1Upper Flat3Addida1   £25,000.00FALSE

I usually tend to DAX everything but I don't mind using P Query if it does deliver the right results.

 

Answering your question above:

If a break date for a location changes to future date Means break date > [Creation Date] - Hidden column

 

Somehow "Don't know yet how" the following should happen:

  • A client name is "Vacant" - then status should be Blank
  • A client has moved into a location "first time", in this case status = Blank
  • A client has remained:
    • Multiple entries can be registered for the same location and same Client as when ever a value in any available table fields is changed a new entry is created "could be Size, Energy Code, Safety code or Break Date, etc..."
      • I need a DAX or PQuery code that would identify per tenant & location the following:
        1. "Today's Break Date Value" > "last Break Date Value" or Blank
        2. "Client Today" = "Client Last" - Then status should be True If not False

 

Thanks again

H

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors