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
Isildur__
Frequent Visitor

If 1 ID has a blank show blank for all other records with the same ID

Hi Guys,

Essentially what I'm trying to do is create a calculated column that returns blank against ID's that have a blank in any other row with the same ID.

The data lets say is like this

IDDate
1001-02-2023
1001-02-2023
10 
1101-02-2023

11

01-02-2023



The final view should look like this. Because ID = 11 has no blank dates we can consider that populated. ID = 10 has one blank therefore we want to show that as not populated.


 

IDDateCheck
1001-02-2023Not all populated
1001-02-2023Not all populated
10 Not all populated
1101-02-2023Populated

11

01-02-2023Populated



What area of DAX does this specifically apply to. Really want to get better at row level comparisons based on previous months, earlier records etc.

1 REPLY 1
lbendlin
Super User
Super User

No need for DAX

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQ0lEyMNQ1MNI1MjAyVorVwSOmAGEaYpFGF4sFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Date = _t]),
    #"Grouped Rows" = Table.Group(Source, {"ID"}, {{"Rows", each _, type table [ID=nullable text, Date=nullable text]}, {"Check", each List.Min([Date]), type nullable text}}),
    #"Expanded Rows" = Table.ExpandTableColumn(#"Grouped Rows", "Rows", {"Date"}, {"Date"}),
    #"Replaced Value" = Table.ReplaceValue(#"Expanded Rows",each [Check], each if [Check]=" " then "Not All Populated" else "All Populated",Replacer.ReplaceText,{"Check"})
in
    #"Replaced Value"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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