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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors