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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Conditional Measure Help

Hi all, I am new in using PowerBI and would appreciate some advise on the current issue I am facing,

 

I have a table that contains the following information:

Part No.     Parent Part Group        Latest Date Practiced         Training

   100                      A                           14-May-2020                   No

   200                      B                            20-Aug-2018                   Yes

   101                      A                        

   300                      C     

   201                      B                              18-Jul-2021                   No             

 

As from the table above, a Parent Part Group has multiple part numbers within it, and the training represents if a specific person requires training for that particular part number (No if its within 2 years of the Latest Date Practiced from today, else yes).

The condition I need to fill the training column with is:

1. Since there is at least one part number that do not require training, then all part numbers within the same parent part group do not require training (See Parent Part Group B and A)

2. If there is no latest date practiced for the part number, then it requires training. (See Parent Part Group C)

Ultimately the result will look like the following table:

Part No.     Parent Part Group        Latest Date Practiced         Training

   100                      A                           14-May-2020                   No

   200                      B                            20-Aug-2018                   No

   101                      A                                                                    No

   300                      C                                                                    Yes

   201                      B                              18-Jul-2021                   No   

 

Hope my example is clear enough.. Thank you so much! 🙂

1 ACCEPTED SOLUTION

@Anonymous Sorry, that line should be:

 

MAXX(__Dates,[Latest Date Practiced) = BLANK(),"Yes",



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Dear @Greg_Deckler 

 

Thank you for your solution however I am getting an error message of:

"The MAX function only accepts a column reference as an argument"

 

@Anonymous Sorry, that line should be:

 

MAXX(__Dates,[Latest Date Practiced) = BLANK(),"Yes",



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

Training 1 Column =
  VAR __ParentPartGroup = [Parent Part Group]
  VAR __Training = 
    DISTINCT(
      SELECTCOLUMNS(
        FILTER(ALL('Table'),[Parent Part Group] = __ParentPartGroup)
        "Parent Part Group",[Parent Part Group]
      )
    )
  VAR __Dates = 
    DISTINCT(
      SELECTCOLUMNS(
        FILTER(ALL('Table'),[Parent Part Group] = __ParentPartGroup)
        "Latest Date Practiced",[Latest Date Practiced]
      )
    )
RETURN
  SWITCH(TRUE(),
    "No" IN __Training,"No",
    MAX(__Dates) = BLANK(),"Yes",
    "Yes"
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.