Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi PBI community, Im new in DAX and I hope you can help me
I have 3 tables, A SellOut table, a Information Company Table and a Calendar Table
I've created a measure with switch:
Classification = SWITCH(TRUE(),
[%Avrg]>=0.8,"A",
[%Avrg]>=0.6,"B",
[%Avrg]<0.6,"C",
"Otro")
Then I put in a matrix visualization and works well but I need to count the Classification and put it in a pie chart
| Company | %Avrg | Classification |
| Store1 | 0.9 | A |
| Store2 | 0.5 | C |
| Store3 | 0.4 | C |
So I tried to put that measure as a column but it give me incorrect results
The measure %Avrg
%Avrg= CALCULATE(DIVIDE([Actual_Month_Avrg],[Last_Month_Avrg],1))
Actual_Month_Avrg= CALCULATE(DIVIDE([Sales],[Days_Use]))
Last_Month_Avrg= CALCULATE(DIVIDE([Sales],[Days_Use]),DATEADD(CalendarTable[Date],-1,MONTH))
Sales= Sum(Sell_Out[Sales])
Days_Use= DISTINCTCOUNT(Sell_Out[Date])
thanks in advance
Hi @oromerot ,
You can create a table2 like :
Then you can use the following measure to count Classification:
Measure =
CALCULATE (
DISTINCTCOUNT ( Table[Company] ),
FILTER ( Table, [Classification] = MAX ( Table2[Classification] ) )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@oromerot , Create a table class with three values A,B,C, you can create using enter data.
then try a measure like
measure =
var _cal =Classification = SWITCH(TRUE(),
[%Avrg]>=0.8,"A",
[%Avrg]>=0.6,"B",
[%Avrg]<0.6,"C",
"Otro")
return
calculate(countrows(Table[Company]), values(Table[Company]) filter(Table, _cal = max(class[Class])))
refer these
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-size-of-bi...
https://www.credera.com/blog/technology-solutions/creating-aging-report-using-a-user-selected-date-i...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 43 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |