Forum Discussion

LizK75's avatar
LizK75
Frequent Visitor
1 year ago
Solved

Max Revenue by Month Issue

I have two tables:

  1. IN for Invoice (contains amount and date columns) - date column is in format of Year Month 
  2. Date (contains Year, Year Month, Month, and date columns)

I’ve created a relationship between IN and Date on the Year Month column (many-to-many relationship). I’ve also defined a measure (Total Revenue):

 

 

 

TotRev = SUM('IN'[amount])

 

 

 

I’m trying to create a table visualization with the following columns:

  • Month (from the Date table)
  • MaxRevenue: This should display the maximum revenue globally.

 

 

MaxRevenue = MAXX(ALLSELECTED('Date'[month]), [TotRev])

 

 

 

What I have

Janv23300
Feb20500
Mar24900
Apr18900
May11235
Jun9000
Jul6500
Aug22750
Sep33000
Oct33000
Nov26750
Dec22125

 

What I want 

Janv33000
Feb33000
Mar33000
Apr33000
May33000
Jun33000
Jul33000
Aug33000
Sep33000
Oct33000
Nov33000
Dec33000

 

  • Hi,

    I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

     

     

     

    Amount measure: = 
    SUM('IN'[amount])

     

     

    expected result measure: = 
    MAXX (
        ALL (
            'Date'[Year],
            'Date'[Year-Month sort],
            'Date'[Year-Month],
            'Date'[Month name],
            'Date'[Month number]
        ),
        [Amount measure:]
    )
    

     

2 Replies

  • Hi,

    I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

     

     

     

    Amount measure: = 
    SUM('IN'[amount])

     

     

    expected result measure: = 
    MAXX (
        ALL (
            'Date'[Year],
            'Date'[Year-Month sort],
            'Date'[Year-Month],
            'Date'[Month name],
            'Date'[Month number]
        ),
        [Amount measure:]
    )
    

     

  • LizK75's avatar
    LizK75
    Frequent Visitor

    Thanks it works.
    I forgot to add 'Date'[Month name] which is crucial.