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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.