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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SNik
Helper I
Helper I

DAX Question MAX Date Record

Hi This is a DAX question i have 2 tables and they are
tblA has a one to many relation with tblB   tblB is a Fct table and tblA a Dim table
TblA (DIM)
aKey  , aName , ....
   1       a
    2     b
 
tblB (FCT)
bKey  aKey   bName    bDate (number format)   fieldA   Field B
  1        1          b 1        20120101                          1            2
  2        1          b 1        20130101                          3            4
  3        2          b 2        20090101                          1            0
  4        2          b 2        20160101                          3            2
 
 
 
How can i get a table output using DAX with the result of the
  1- the last date for each record
  2- If Field A> Field B then "Red" else "Green"
 
  2        1          b 1        20130101     GREEN
  4        2          b 2        20160101     RED
 
I need the DAX for that , Thanks

 and do i add the DAX in the FCT of the DIM ?

 

I am using Excel 2013 PowerPivot

Sincerely
Nik- Shahriar Nikkhah
2 REPLIES 2
Greg_Deckler
Super User
Super User

You can add a custom column in your dimension table like:

 

MAX(RELATED(Fact[bDate]))


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

how can i do that?

must i use the DAX in the Fact?

can you help me is in the step by step?, i dont need the details as long as i can understand the steps more i'll follow and find out myself

thanks

Please help more

Sincerely
Nik- Shahriar Nikkhah

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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