Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi I'm trying to insert a measure in my power bi solution with the same syntax of a previusly created calculated column.
The behavior of the two formulas is slightly different and I do not know why.
I have two tables, the first is a data dimension table and the second is a fact table joined together.
On the data dimension table I have created a measure like this:
StartDate = CALCULATE(MIN(DimData[DataFormattata]);ALLSELECTED(DimData[DataFormattata]))
Then I've created the calculated column with this formula:
Parita = if (min(Negozi[TNE_DataApertura])<=[StartDate];"Parità";"NoParità")
and a Measure (Called MisParita) with the same formula.
When I create a matrix (with some of these columns and the two incriminated formulas on a power bi sheet I see that the results are different.
Can you explain me why this formula give me two different result?
Thank in advance!
Hi @Marcox28,
First of all you need t understand that measures and calculated columns are different, the main difference is the evaluation context of each one.
Check this link were you have a explanation and some examples for each one and how you the react depending on context.
Looking at your case you can't filter a calculated column based on a measure since the context of the column will be different on the measure you are filtering, so when you aplly it to a column it will give odd result.
Making a simple test you can check that the measure you use for the calculted column his always giving you the minimum date of the tableand not the one in the filter. When you add it to a measure it wil give you the expectet change based on the slicer check the example below:
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsRegards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI would like to get a matrix where I can see the regroupment by parity. as the first field the calculation of the calculated parity column and by drilling down display the details of the stores.
@Marcox28,
Calculated column will not response to slicer selections, see https://community.powerbi.com/t5/Community-Knowledge-Base/Calculated-Column-Table-Change-Dynamically....
In your scenario, to make Parita dynamically change according to date slicer, you would need to create a measure, however, measure can't be dragged into Rows of Matrix, thus it is not possible to create the Matrix as you describe.
A workaround is to create a summarized table containing Parita measure, and then create Matrix visual using this summarized table, but in this case, Parita measure will act as a static column in the summarized table and it can't be changed dynamically.
Regards,
Lydia
Hello,
It is incredible that PowerBI does not have a variable management such as qlik and tableau, I hope it will be implemented soon.
Yesterday I tried to study an alternative to get the matrix I need.
I feel that I am close to the solution but my knowledge does not help me.
I try to explain my reason:
I created a table with three columns, date column, shop column and parity column with two values a and c.
for each store I entered the values of the whole calendar with values c for every day that the store was closed while for all the remaining days.
here is the table.
and these are the relationships
creating the matrix object I have only one problem:
when I select a given silgola everything works correctly, when instead selecting a range of data the stores are displayed both in group a and in group c.
is there a way to display it in group c if there is no value a and in group a if there is a value a?
"is there a way to display it in group c if there is no value a and in group a if there is a value a?"
Could you please describe above requirement? Which table does the Ultime TNE_Descrizione field come from? What is your expected result based on the above sample data?
Regards,
Lydia
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |