Forum Discussion

gauravnarchal's avatar
gauravnarchal
Icon for Post Prodigy rankPost Prodigy
4 years ago

Need help with measure & Row total

I need help to create a measure to calculate the Sale percentage amount

 

  • If the Invoice date is equal to or less than 30th June 22
    • If Gross Amount < 7000 return 0 or  Gross Amount > 50001 return 5000 else Gross Amount *0.05
  • If the Invoice date is equal to or greater than 1st July 22
    • If Gross Amount < 50000, Gross amount * 0.03, If Gross Amount > 75000 , Gross amount * 0.05 else Gross Amount *0.75

Please click the below link to download the PBIX file.

 

Click here

 

Thanks

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi gauravnarchal ,

    I cannot accss you pbix file. Please refer to my pbix file to see if it helps you.

    Create a column.

    month = MONTH('Table'[date])

    Then create a measure.

    Measure =
    VAR _1 =
        IF (
            MAX ( 'Table'[month] ) <= 6
                && MAX ( 'Table'[Gross Amount] ) < 7000,
            0,
            IF (
                MAX ( 'Table'[month] ) <= 6
                    && MAX ( 'Table'[Gross Amount] ) < 50000
                    && MAX ( 'Table'[Gross Amount] ) > 7000,
                1,
                MAX ( 'Table'[Gross Amount] ) * 0.05
            )
        )
    VAR _2 =
        IF (
            MAX ( 'Table'[month] ) >= 7
                && MAX ( 'Table'[Gross Amount] ) < 50000,
            MAX ( 'Table'[Gross Amount] ) * 0.03,
            IF (
                MAX ( 'Table'[month] ) >= 7
                    && MAX ( 'Table'[Gross Amount] ) > 75000,
                MAX ( 'Table'[Gross Amount] ) * 0.05,
                MAX ( 'Table'[Gross Amount] ) * 0.75
            )
        )
    RETURN
        IF (
            MAX ( 'Table'[month] ) <= 6,
            _1,
            IF ( MAX ( 'Table'[month] ) >= 7, _2, BLANK () )
        )
    

     

    If I have misunderstood your meaning, please provide your pbix file without privacy information and more desired output with your desired output.

     

    Best Regards

    Community Support Team _ Polly

     

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