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
x0
Helper I
Helper I

Measure calculation divide function not work

Hello Everyone , 

 

 

I have created 3 simple measure , unfortunatley from 3 of 2 is working and 1 is not work well anyone have any suggestion ? 

here i am sharing 3 measure . with that i also share what my need , you may also refer me if something difrent method for achive my aim 

1st measure 

 

Total Name Count =
CALCULATE(
    COUNTROWS('Move Insq'),
    'Move Insq'[MonthIndex] IN VALUES('CustomTable'[MonthIndex]),
    'Move Insq'[Year] IN VALUES('CustomTable'[Year]),
    'Move Insq'[Property] IN VALUES('CustomTable'[Property]),
    'Move Insq'[First Name] <> BLANK()
)
this measure count row each names  and i used this on my matrix visueal value for see each employee count , which very well working 
 
2nd measure is 
Total Move insq percent =
VAR NumMonthsSelected = COUNTROWS(VALUES('CustomTable'[MonthIndex]))

VAR MoveInsWithCustomData =
    FILTER(
        'Move Insq',
        'Move Insq'[MonthIndex] IN VALUES('CustomTable'[MonthIndex]) &&
        'Move Insq'[Year] IN VALUES('CustomTable'[Year]) &&
        'Move Insq'[Property] IN VALUES('CustomTable'[Property]) &&
        'Move Insq'[First Name] <> BLANK()
    )
RETURN
    DIVIDE(
        COUNTROWS(MoveInsWithCustomData),
        NumMonthsSelected,
        0  -- Specify the value to return if the denominator is zero
    )
this measure i used on advance 123 card for see total row and its also working well. show me correct value 
 
now 3rd measure is this 
NameCountRatio =
DIVIDE(
    [Total Name Count],
    [Total Move insq percent],
    BLANK()
)
with this measure i want to do divide name count value / with total move insq percent value count 
this measure is trouble for me because its returning 100 % for all row .
might be total name count measure and total percent count doing same  calculation on first part which is count row then i add do divide with selected month on total move ins1 
 
i need to fix this any how i am too much tired playing arround in this smaller thing
i all share screen shots for better understand 
x0_0-1711014767305.png

 

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

Hi @x0 ,

 

Create a measure that outputs the numerator and denominator separately.

DebugNameCountRatio = 
"Numerator: " & FORMAT([Total Name Count], "General Number") & 
", Denominator: " & FORMAT([Total Move insq percent], "General Number")

 

Drag and drop the DebugNameCountRatio onto the card visual object on the report page to display it, to determine if the numerator and denominator are the same.

 

I also did some testing, maybe that helps:

 

I have the following DAX expressions, the first three are measures and the last two are calculated columns.

Measure = SUM('Table'[value])

Measure 2 = DIVIDE(MAX('Table'[value]),SUM('Table'[value]))

Measure 3 = DIVIDE(MAX('Table'[value]),[Measure])

Column = DIVIDE('Table'[value],[Measure])

Column 2 = DIVIDE('Table'[value],SUM('Table'[value]))

 

Only Column2 is calculated correctly.

 

You can try replacing measure with calculated column and do not include measures in the calculated columns, and you can copy the logic of measures to the parameter part of the DIVIDE function.

 

I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

1 REPLY 1
v-huijiey-msft
Community Support
Community Support

Hi @x0 ,

 

Create a measure that outputs the numerator and denominator separately.

DebugNameCountRatio = 
"Numerator: " & FORMAT([Total Name Count], "General Number") & 
", Denominator: " & FORMAT([Total Move insq percent], "General Number")

 

Drag and drop the DebugNameCountRatio onto the card visual object on the report page to display it, to determine if the numerator and denominator are the same.

 

I also did some testing, maybe that helps:

 

I have the following DAX expressions, the first three are measures and the last two are calculated columns.

Measure = SUM('Table'[value])

Measure 2 = DIVIDE(MAX('Table'[value]),SUM('Table'[value]))

Measure 3 = DIVIDE(MAX('Table'[value]),[Measure])

Column = DIVIDE('Table'[value],[Measure])

Column 2 = DIVIDE('Table'[value],SUM('Table'[value]))

 

Only Column2 is calculated correctly.

 

You can try replacing measure with calculated column and do not include measures in the calculated columns, and you can copy the logic of measures to the parameter part of the DIVIDE function.

 

I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

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.