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.
Hello!
I have a column + line graphic and I need a new measure that gets the higher column and make a single value that goes by the entire graphic. I'm terrible at explaining this, so I'll try to put in images.
Instead of the higher value per month with line, I want my graphic to get like this a straight line following the higher column, no matter the year + week:
The values from the graphic comes from this formula:
Solved! Go to Solution.
make sure to refer to the same year + week column that is present in the chart visual.
MaxFormula =
MAXX ( ALLSELECTED ( 'Calendar'[Year + Week] ), [Formula] )
Hi @marcelocostafil ,
Thanks for the reply from tamerj1 .
Here is the sample data I created.
Date |
Product ID |
ProductA Sales |
ProductB Sales |
2024/01/01 |
AAA |
100 |
250 |
2024/02/01 |
BBB |
150 |
150 |
2024/03/01 |
CCC |
250 |
200 |
2024/04/01 |
DDD |
200 |
350 |
2024/05/01 |
EEE |
450 |
200 |
2024/06/01 |
FFF |
350 |
120 |
2024/07/01 |
GGG |
400 |
280 |
Create an index column in Power Query to better sort the chart.
Create a calculated column to calculate the week of year:
Year & Week = YEAR('Table'[Date]) & " " & WEEKNUM('Table'[Date])
Create a measure:
Max Sales =
MAXX(
{
(CALCULATE(MAX('Table'[ProductA Sales]), ALL('Table'))),
(CALCULATE(MAX('Table'[ProductB Sales]), ALL('Table')))
},
[Value]
)
The final page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Thank you so much!!
I was missing the "ALSELECTED" 😞
In the end, I've used both columns like this:
Hi @marcelocostafil ,
Thanks for the reply from tamerj1 .
Here is the sample data I created.
Date |
Product ID |
ProductA Sales |
ProductB Sales |
2024/01/01 |
AAA |
100 |
250 |
2024/02/01 |
BBB |
150 |
150 |
2024/03/01 |
CCC |
250 |
200 |
2024/04/01 |
DDD |
200 |
350 |
2024/05/01 |
EEE |
450 |
200 |
2024/06/01 |
FFF |
350 |
120 |
2024/07/01 |
GGG |
400 |
280 |
Create an index column in Power Query to better sort the chart.
Create a calculated column to calculate the week of year:
Year & Week = YEAR('Table'[Date]) & " " & WEEKNUM('Table'[Date])
Create a measure:
Max Sales =
MAXX(
{
(CALCULATE(MAX('Table'[ProductA Sales]), ALL('Table'))),
(CALCULATE(MAX('Table'[ProductB Sales]), ALL('Table')))
},
[Value]
)
The final page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
make sure to refer to the same year + week column that is present in the chart visual.
MaxFormula =
MAXX ( ALLSELECTED ( 'Calendar'[Year + Week] ), [Formula] )
Thank you so much!!
I was missing the "ALSELECTED" 😞
In the end, I've used both columns like this:
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |