Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
I have a table ("Interactions") that looks like this:
Date Team Interactions Source
15/03/2024 | Training | 328 | Emails |
06/04/2024 | Training | 456 | Calls |
31/05/2024 | Membership | 123 | Emails |
31/05/2024 | Membership | 258 | Calls |
It's connected to my "Calendar" (i.e. Date) Table.
I have a visual (line graph) which has month along the x-axis and sums interactions on the Y axis with the Source in the Legend.
Unfortunately I need to replace the figure for Emails from Training during May 2024 with 4106.
I tried to do this with an IF statement but it doesn't aggregate properly, it replaces the point on the diagram that should be the 4106 + the value for Emails Membership for May, with just the 4106.
Measure = IF( MAX(Interactions[Team]) = "Training" && MAX(Interactions[Source]) = "Emails" && YEAR(MAX('Calendar'[Date])) = 2024 && MONTH(MAX('Calendar'[Date])) = 5 , 4160, SUM(Interactions[Interactions]) )
I think that was because I used a MAX value in the filtering (so when faced with Training values combined with Membership, it just takes the MAX - i.e. Training), but I can't work out what I should use instead so there aren't the same problems with aggregating.
Tried a lot of other things as well, without success
Can anyone put me right on this?
Thank you!
Hello,
You can consider the following to see if this will get you your intended result:
Measure =
VAR _Interactions =
IF (
AND ( Interactions[Team] = "Training", Interactions[Source] = "Emails" ),
TRUE (),
FALSE ()
)
VAR _Date =
IF (
AND ( YEAR ( 'Calendar'[Date] ) = 2024, MONTH ( 'Calendar'[Date] ) = 5 ),
TRUE (),
FALSE ()
)
RETURN
IF ( AND ( _Interactions, _Date ), 4160, SUM ( Interactions[Interactions] ) )
Proud to be a Super User! | |
Hi, thanks for you answer, unfortunately, though I still have to add the MAX() function around the fields (or else I get errors) and then that seems to lead me back to where I was before – same results at least. I'd been hoping there was a better alternative to MAX for text, or something like HASONEVALUE().
I really appreciate the suggestion, though.
Matt
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
9 |