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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
x0
Helper I
Helper I

measures - Dividing 2 measure to get a percentage measure

Hello All , 

 

 i have created 2 measure which is here below 

1 st measure is look like this 

Total Names Count Divided by 3 =
VAR SelectedMonths = VALUES('CustomTable'[MonthIndex])
VAR SelectedYears = VALUES('CustomTable'[Year])
VAR SelectedProperties = VALUES('CustomTable'[Property])

RETURN
    DIVIDE(
        COUNTROWS(
            FILTER(
                'Move Insq',
                'Move Insq'[MonthIndex] IN SelectedMonths &&
                'Move Insq'[YearPart] IN SelectedYears &&
                'Move Insq'[Property] IN SelectedProperties
            )
        ),
        3
    )
and 2nd measure look like this 
Total Move insq percent =
VAR LeasingAgentsWithCustomData =
    FILTER(
        'Move Insq',
        'Move Insq'[MonthIndex] IN VALUES('CustomTable'[MonthIndex]) &&
        'Move Insq'[YearPart] IN VALUES('CustomTable'[Year]) &&
        'Move Insq'[Property] IN VALUES('CustomTable'[Property]) &&
        'Move Insq'[First Name] <> BLANK()
    )
RETURN
    DIVIDE(
        COUNTROWS(LeasingAgentsWithCustomData),
        3
    )
 now i want to create third measure which is final pecentage measure 
Final Measure1 =
VAR Ratio = DIVIDE(
    [MoveIns Total First Names Divided by 3],
    [Total Names Count Divided by 3]
)
RETURN
    IF(
        ISBLANK(Ratio),
        BLANK(),
        FORMAT(Ratio, "0%")
    )
something look like this  but it dosent work. 
not showing accurate value as i compare with manually 
i want to 
[
Total Names Count Divided by 3] divide with [
Total Move insq percent] and the value i want in percentage 
can you guys help me to fix this issue ? 
 
3 REPLIES 3
lbendlin
Super User
Super User

You cannot measure a measure unless you have materialized it.  Implement your entire business logic in a single measure.

hello @lbendlin 

 

how can i use single logic ?

can you please giud me ? 

my reuirenment is very simple 

this measure result 

Total Names Count Divided by 3 =
VAR SelectedMonths = VALUES('CustomTable'[MonthIndex])
VAR SelectedYears = VALUES('CustomTable'[Year])
VAR SelectedProperties = VALUES('CustomTable'[Property])

RETURN
    DIVIDE(
        COUNTROWS(
            FILTER(
                'Move Insq',
                'Move Insq'[MonthIndex] IN SelectedMonths &&
                'Move Insq'[YearPart] IN SelectedYears &&
                'Move Insq'[Property] IN SelectedProperties
            )
        ),
        3
    )
 
 divide with this  measure total 
 
 
Total Move insq percent =
VAR LeasingAgentsWithCustomData =
    FILTER(
        'Move Insq',
        'Move Insq'[MonthIndex] IN VALUES('CustomTable'[MonthIndex]) &&
        'Move Insq'[YearPart] IN VALUES('CustomTable'[Year]) &&
        'Move Insq'[Property] IN VALUES('CustomTable'[Property]) &&
        'Move Insq'[First Name] <> BLANK()
    )
RETURN
    DIVIDE(
        COUNTROWS(LeasingAgentsWithCustomData),
        3
    )

so concept is i have column called first name 

there is multiple names and also has same names now i created this measure which will count total and then divide 3 

Total Move insq percent =
VAR LeasingAgentsWithCustomData =
    FILTER(
        'Move Insq',
        'Move Insq'[MonthIndex] IN VALUES('CustomTable'[MonthIndex]) &&
        'Move Insq'[YearPart] IN VALUES('CustomTable'[Year]) &&
        'Move Insq'[Property] IN VALUES('CustomTable'[Property]) &&
        'Move Insq'[First Name] <> BLANK()
    )
RETURN
    DIVIDE(
        COUNTROWS(LeasingAgentsWithCustomData),
        3
    )
and also with that i created another measure which will count names how many times name appear and then divide 3 
 
now third value i want which will show percentage so i want that count names measure will divide with total counts measure value example total count i get after divide with 3 is 32 and my counts per name total 4,6,7,8,9 as per data names. should be divide with with total means 32 
4/32 , 6/32, 7/32 ....... now whatever value comes with this calculation that is my percentage value.  
MonthIndexYearproperty First name 
52023LondonLency luis 
32023ParisDavid becahar
52023Tokyolency luis 
52024Maldivslucky fire
42024AmericaDavid jhones 
42024EgyptDavid jhones 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors