Q&A Power BI and Cortana

A very interesting feature that was present from the first version of Power BI is the Q & A . In practice, the Power bi used imported data inside the model to answer questions about the data.

Today the same function exists yet on Power bi, and I refer you to the following video you tube if you want to see how it works: Power BI Q&A

Continua a leggere

Dax Tips and Tricks: Divide vs Divide

An interesting function on DAX si DiVIDE.

Un interessante funzione che pochi conoscono e sfruttano in DAX è DIVIDE. It often happens that when you create a measure in dax , especially if you take advantage of the time intelligence you want to create delta and Delta % Measure.

Normally a person would write , to make a Delta % vs PY CY , the following formula :

Delta % CY vs PY := ([AMount CY] -[Amount PY]) / [Amount PY]

What usually happens is the abscence of py data, dax not handle in automatic a value divide by zero  and this is what happen:

dax.PNG

A simple solution can be use the if statement:

if(isblank([amount py]);0;formula).

This Formula is very inefficient for you and for the model, you have to use this:

Delta % CY vs PY:=divide([AMount CY] -[Amount PY];[Amount PY];0)

In automatic way Dax control if it’s possible to do the division, if isn’t possible then:

  • insert blank value if i don’t insert nothing in the formula
  • Insert specific value ( in our example the zero value)