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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.