Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
I am having a problem with the graphic of some datas.
First, I have the following table:
Where:
Solved! Go to Solution.
Ok, @Anonymous I got your file. I did a little digging and now it makes sense to me. Measures return a single value, which depends on the filter context. You cannot use that in a legend. You have two options that I see:
Then create a measure you want in your values part of the chart.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingA couple of things that might help.
First, consider using SWITCH instead of multiple nested IF statements. So
METAS1 =
IF(
[MTTR DIC]
> VALUE( META_MTTR[MTTR MAX] );
"INEFICIENTE";
IF(
[MTTR DIC]
< VALUE( [MTTR PROM] );
"EXCEDE";
IF(
AND(
[MTTR DIC]
< VALUE( [MTTR MAX] );
[MTTR DIC]
> VALUE( [MTTR PROM] )
);
"CUMPLE META";
"n/d"
)
)
)
Becomes:
METAS1 =
SWITCH(
TRUE(),
[MTTR DIC] > VALUE( META_MTTR[MTTR MAX] ), "INEFICIENTE",
[MTTR DIC] < VALUE( [MTTR PROM] ), "EXCEDE",
[MTTR DIC] < VALUE( [MTTR MAX] )
&& [MTTR DIC] > VALUE( [MTTR PROM] ), "CUMPLE META",
"n/d"
)
Note I haven't validated that measure because I didn't have data I could copy and paste into Power BI.
It doesn't work in a Pie Chart though because there are no values. You need values to make a visual work, and you have two columns of text.
Create this measure in your table:
Data Account = COUNTROWS(TableName)
Now drop that value in the pie chart. Use the METAS1 measure as your legend for the chart.
This will just tell you the number of times each label in METAS1 shows up. You could use any measure that evaluates to a numerical value as your Value amount fo the visual.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHey @edhans
Thanks!
I change the measure from "if" to "switch", and help a lot.
But, I can´t make the pie chart yet, although I created the "Data account" measure, I am trying to put METAS1 in the legend section but it still doesnt allow me to do it.
Do you have any idea?
I'd have to see your PBIX file or more info. It works fine for me.
You can actually drag your METAS1 field to Values and tell Power BI to do a count, but that can cause problems later if you make any changes to how METAS1 works. Always best to do an explicit measure, even for something as simple as a row count.
Post a sample PBIX file if this isn't working for you. Use OneDrive or something similar to share.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingOk, @Anonymous I got your file. I did a little digging and now it makes sense to me. Measures return a single value, which depends on the filter context. You cannot use that in a legend. You have two options that I see:
Then create a measure you want in your values part of the chart.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |