Forum Discussion
IF and AND
Hello i am trying to put some code in to check
if MAX date from date table = Today(),
AND Group = "Mail"
Then
"Data Available"
Else
Data Not Available
any ideas?
Hi,
there's some information missing (e.g. where is the Group-Column and how is the table connected to the date table?) but assuming there's a fact table with a Date which is linked to the Date column in your Date table and a Column Group which can have the value "Mail" this should do the trick. You can add it to a card for example.
VAR isAvailable = CALCULATE( MAX(dateTable[Date]), yourOtherTable[Group] = "Mail" ) = TODAY() RETURN IF(isAvailable, "Data Available", "Data Not Available")
5 Replies
- AnonymousNot applicable
Hi NewbieJono
Try
if(MAX('table'[date] = Today() && 'table'[Group] = "Mail","Data Available","Data Not Available")- NewbieJono
Post Partisan
on this after the && it will not let me select a table here, only measures
if(MAX('table'[date] = Today() && 'table'[Group] = "Mail","Data Available","Data Not Available")
- lukiz84
Memorable Member
Hi,
there's some information missing (e.g. where is the Group-Column and how is the table connected to the date table?) but assuming there's a fact table with a Date which is linked to the Date column in your Date table and a Column Group which can have the value "Mail" this should do the trick. You can add it to a card for example.
VAR isAvailable = CALCULATE( MAX(dateTable[Date]), yourOtherTable[Group] = "Mail" ) = TODAY() RETURN IF(isAvailable, "Data Available", "Data Not Available")- NewbieJono
Post Partisan
This don't seem to work, the data is all in one table
Mail isAvailable = VAR isAvailable = CALCULATE( MAX('FACT - TEST'[Date]), 'FACT - TEST'[Grouping] = "Mail Opening" ) = TODAY() RETURN IF(isAvailable, "Data Available", "Data Not Available")- lukiz84
Memorable Member
Do you have any more infos? What does the measure return?