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
jnguyen21
Frequent Visitor

Calculation only shows up on total, but not individual lines

Help! I am dividing the dollars by the qty, however the expense lines come up blank. Any idea what I am missing?

 

Test Qty = [Qty Actual] + [Qty Rest of the year]

- this is calculated with 6 months of actual and 6 months of forecast

Test Dollars = "Total Dollars"

Test Qty / Dollars = DIVIDE([Test - Dollars],[Test Qty])

 

jnguyen21_0-1633711401068.png

 

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @jnguyen21 

 

According to the display in your table, the measure you wrote will not be calculated according to your logic.

vjaneygmsft_1-1634028235750.png

If you want to get the correct result, please share how your [Test Qty] and [Test Dollars] are calculated? Then we can try to help you modify the code.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.


Best Regards,

Community Support Team _ Janey

 

 

jnguyen21
Frequent Visitor

I would like divide each line so i thought it would be 

648,899 / 12,935,936 = .05

1,568,319 / 12,935,936 = .12
but is only dividing the total line 

How are your [Qty Actual] and [Qty Rest of the year] defined?

AlexisOlson
Super User
Super User

You're dividing by zero so DIVIDE returns a blank for these rows. You can add a third argument to divide to return something other than a blank when dividing by zero. E.g. 

Test Qty / Dollars = DIVIDE ( [Test - Dollars], [Test Qty], 0 )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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