Forum Discussion
Divide function not giving right value
- 4 years ago
Probably a filter context issue...
What is the code for both measures and
what does each measure in the DIVIDE function deliver in a card visual?
Also what does the % measure deliver for the total row if added to the table visual?
jalaomar ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Try like
Divide([Count of VSU fullfilment]*1.0, [Count Total])
- jalaomar4 years agoHelper IV
Hi, These are my measures
VSU Days = DATEDIFF('KPI'[MIS3.1Actual 2];'KPI'[ITG4Actual2];DAY)
VSU 5 weeks = IF('KPI'[VSU Days] <=35; "1";"0")
PVoT Days = DATEDIFF('KPI'[ITG4Baseline2];'KPI'[ITG4Actual2];DAY)
ITG4 fullfillmentX = SWITCH(TRUE();
ISBLANK('KPI'[PVoT Days]);0;'KPI'[PVoT Days]>=1;0;'KPI'[PVoT Days]<=0;1;0)Count total = CALCULATE(COUNTROWS('KPI'))
Count of VSU fullfillment = CALCULATE(COUNTROWS('KPI'); FILTER('KPI';'KPI'[VSU 5 weeks]="1"))calculate margin% = CALCULATE(DIVIDE('KPI'[Count of VSU fullfillment];'KPI'[Count total]))Was not able to provide sample datai tried your measure and it gave me an error as shown in the screenshot- PaulDBrown4 years agoCommunity Champion
Change the [Count of SVU fulfillment] to
Count of VSU fullfillment = CALCULATE(COUNTROWS('KPI'); FILTER('KPI'; [VSU 5 weeks]=1))
Also, please provide the answers to the following:
what does each measure in the DIVIDE function deliver in a card visual?
Also what does the % measure deliver for the total row if added to the table visual?- jalaomar4 years agoHelper IV
Hi,
What should I change in the measure?
Count of VSU fullfillment = CALCULATE(COUNTROWS('KPI'); FILTER('KPI'; [VSU 5 weeks]="1"))
what does each measure in the DIVIDE function deliver in a card visual?
Count of VSU fullfillment measure is calculating the total number of rows that has the value 1 (1 is a string)
Count Total is a measure calculating the total number of rows in the table
Calculate margin% is calculating the % of projects that have the value 1
Value 1 is indicating that the project has managed to deliver a machine within 35 days (diff between 2 actual dates)
Also what does the % measure deliver for the total row if added to the table visual?
Count Total & Count of VSU fullfillment I will not visualize in the table, just wanted to verify that the measure is working properly
but Magin% i need to visualize as it is the KPI value to indicate the % of projects that has reached target.