The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
User | Count |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |