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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
YuliyaMusiyuk
Regular Visitor

% Of revenue per outlet

Hello,

i am trying to calculate % of revenue per outlet; see below - i need each Cat-Category to be devided by Total rev in that Cat-DepartmentDesc

YuliyaMusiyuk_0-1628529033550.png

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @YuliyaMusiyuk ,

 

Please try the following formula :

div by rev =
VAR _rev =
    CALCULATE ( SUM ( 'Table'[REV] ), ALLEXCEPT ( 'Table', 'Table'[Cat-Depart] ) )
VAR _mtd =
    CALCULATE (
        SUM ( 'Table'[CY MTD] ),
        FILTER (
            'Table',
            'Table'[Cat-Depart] = MAX ( 'Table'[Cat-Depart] )
                && 'Table'[Cat-Category] = MAX ( 'Table'[Cat-Category] )
        )
    )
RETURN
    DIVIDE ( _mtd, _rev )

Then format the measure as 2 decimal places. The final output is shown below:

Two decimal places.PNGdiv by rev.PNG

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @YuliyaMusiyuk ,

 

Please try the following formula :

div by rev =
VAR _rev =
    CALCULATE ( SUM ( 'Table'[REV] ), ALLEXCEPT ( 'Table', 'Table'[Cat-Depart] ) )
VAR _mtd =
    CALCULATE (
        SUM ( 'Table'[CY MTD] ),
        FILTER (
            'Table',
            'Table'[Cat-Depart] = MAX ( 'Table'[Cat-Depart] )
                && 'Table'[Cat-Category] = MAX ( 'Table'[Cat-Category] )
        )
    )
RETURN
    DIVIDE ( _mtd, _rev )

Then format the measure as 2 decimal places. The final output is shown below:

Two decimal places.PNGdiv by rev.PNG

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

ryan_mayu
Super User
Super User

@YuliyaMusiyuk 

could you pls provide some sample data?  I am confused about your description and screenshot.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.