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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ACraig08
Helper I
Helper I

Display only Max and Min values for line graph per month by fiscal year

I am wondering if it is possible to only show the maximum and minimum values within each month as highlighted.

ACraig08_0-1715087775146.png

 

1 ACCEPTED SOLUTION

Hi,

@Alex87 , thanks for the concern about the problem, and i want to offer somre more information for user to refer to.

hello @ACraig08  based on your sample data, i create some sample data

vxinruzhumsft_0-1715148826641.png

Then  and your average amout need to change to the following.

Average amount =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Data'[Unqiue ID] ),
        ALLEXCEPT ( 'Data', 'Data'[Date].[MonthNo], 'Data'[Years] )
    )
VAR b =
    CALCULATE (
        SUM ( 'Data'[Amount] ),
        ALLEXCEPT ( 'Data', 'Data'[Date].[MonthNo], 'Data'[Years] )
    )
RETURN
    DIVIDE ( b, a ) + 0

Then create a data label measure

Data_label =
VAR a =
    MAXX (
        FILTER (
            ALLSELECTED ( 'Data' ),
            [Date].[MonthNo] IN VALUES ( 'Data'[Date].[MonthNo] )
        ),
        [Average amount]
    )
VAR b =
    MINX (
        FILTER (
            ALLSELECTED ( 'Data' ),
            [Date].[MonthNo] IN VALUES ( 'Data'[Date].[MonthNo] )
        ),
        [Average amount]
    )
RETURN
    IF ( [Average amount] IN { a, b }, [Average amount] )

Then put the following field to line visual.

vxinruzhumsft_1-1715149447201.png

 

Then open data label and put the data label measure to the value.

vxinruzhumsft_2-1715149505513.png

 

Output

vxinruzhumsft_3-1715149562087.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Alex87
Solution Supplier
Solution Supplier

Hello,

Yes, I think it is possible. If you need a more detailed answer than Yes/No, please provide sample data so that we can replicate your use case.

Yes I do need more than a Yes/No, I would like help on how to achieve this. However, I cannot provide sample data as it is private. I can say that it looks like this:

Unique IDDateFiscal YearAmount
a05/02/2021202123,153,152.00
b06/22/20212021135,258.00
c08/24/20212022458,158.00
d01/01/2022202212,252,255.00

I created a measure for the average amount: sum(Amount)/distinctcount(Unique ID) + 0

I have the "+ 0" so that my line chart will show all the lines from start to finish.

 

X-axis = Date: Month

Y-Axis = Average Amount

Legend = Fiscal Year

 

I hope that helps

Hi,

@Alex87 , thanks for the concern about the problem, and i want to offer somre more information for user to refer to.

hello @ACraig08  based on your sample data, i create some sample data

vxinruzhumsft_0-1715148826641.png

Then  and your average amout need to change to the following.

Average amount =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Data'[Unqiue ID] ),
        ALLEXCEPT ( 'Data', 'Data'[Date].[MonthNo], 'Data'[Years] )
    )
VAR b =
    CALCULATE (
        SUM ( 'Data'[Amount] ),
        ALLEXCEPT ( 'Data', 'Data'[Date].[MonthNo], 'Data'[Years] )
    )
RETURN
    DIVIDE ( b, a ) + 0

Then create a data label measure

Data_label =
VAR a =
    MAXX (
        FILTER (
            ALLSELECTED ( 'Data' ),
            [Date].[MonthNo] IN VALUES ( 'Data'[Date].[MonthNo] )
        ),
        [Average amount]
    )
VAR b =
    MINX (
        FILTER (
            ALLSELECTED ( 'Data' ),
            [Date].[MonthNo] IN VALUES ( 'Data'[Date].[MonthNo] )
        ),
        [Average amount]
    )
RETURN
    IF ( [Average amount] IN { a, b }, [Average amount] )

Then put the following field to line visual.

vxinruzhumsft_1-1715149447201.png

 

Then open data label and put the data label measure to the value.

vxinruzhumsft_2-1715149505513.png

 

Output

vxinruzhumsft_3-1715149562087.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That worked perfectly!! Thank you!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.