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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

bug What If with decimal numbers

I have a problem with what if.

A measure was created according to the following DAX: pDolar = GENERATESERIES(0, 20, 0.01)

In short, I need to advance in decimal form every 1 cent of dollars.
However, in my data segmentation, if I type 6.10 the value to be filled is 6.11, in addition, even the value configured in the decimal format with 2 places, this is not being respected as shown in the image below

 

1.png

 

 

When I type 6.10

 

2.png

 

The saved value is 6.11

 

3.png

 In addition, for my demand, which is internal to a company, I cannot leave the slicer.
That is, my look needs to be in this format:

 

4.png

 

Any way to get around this bug? Has Microsoft already spoken out?
My power bi desktop is in the latest version:

 

5.png

Status: New
Comments
parry2k
Super User

@afonsofeliciano  Yes I was able to reproduce the issue and it need fix.

 

 

marcos_osorio
Helper II

@afonsofeliciano @parry2k 

Same problem for me.

 

Anonymous
Not applicable

A workaround for this issue can be to use casting in GENERATESERIES function as shown by Marco Russo here: https://www.sqlbi.com/articles/generating-a-series-of-numbers-in-dax/.

afonsofeliciano
Frequent Visitor

@Anonymous thanks for your contribution.

 

however, I performed these tests previously, since I found a page here in Brazil with the same content informed by you on this sqldbi website.

When I create the measure 

testMeasure= SELECTCOLUMNS( GENERATESERIES(1, 100, 0.01), "Value", CURRENCY([Value]))
 

I can solve part of the problem:

part 1: the value of the decimal place, is really fixed in just two places.

part 2 and more importantly: when I type in a certain number, the data segment interprets it as another number. For example, when I type 12, what appears is 11.98. That is, there is no precision in the data input that must be done by the end user.

deevs
Helper III

 HI afonsofeliciano

This is my solution and working like charm 😊

 

In my scenario user had to enter exchange rate value range between 0.0001 and 999999.9999 and it was very challenging to deal with even given the what if was working perfectly. Coz if you generate a sequence with 1 million rows the pibx file size will go from 5 MB to 1GB which is a efficient at all.

My way you can avoid this bug which rounds off weirdly as well as it won’t increase your pibx file size.

I created four what if parameters. In your situation you might be able to get it done with two parameters.

 Then I concatenated those four value measures as a text and then converted to a decimal number. I have put a screenshot below. Let me know if it doesn’t work I will share you with a pibx template.

 

Thanks,

 

Deevsimage.png

 

 

 

 

 

 

 

 

 

fjjpeeters1976
Helper I

I am currently having the same issue as the writer of this article. Does anyone know if there has been any fix done in the last years?

 

BR, Frank

rasmus8
New Member
Likewise facing the same issue - seems to work as long as you don't go beyond +/-5 with two decimals, but need more than that Best, Rasmus
rasmus8
New Member
Found a work around in case anyone else ends up here with the same issue. Chaing the slizer from single value to Greater than or equal to, and then change the SELECTEDVALUE to MIN in the associated VALUE part of the parameter. It then works perfectly with two decimals. In the greater than or equal to only one input box is active, so you can just hide the other with a textbox or likewise on top.