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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SebastianY
Regular Visitor

It seems like PowerBI simply don't want to work

Hi everyone

 

I've been having a problem that I can't solve (and yes, I've already asked Chat GTP).

 

My problem is the following:

 

I have this DAX formula:

 

 

 

Ventas con Otros =

VAR PorcSales = [TotalSales] * 0.01

//I create a summarize the table with customers and the their total sales
VAR SumTable =
SUMMARIZE(SALES, 'MY TABLE'[NAME], "CustomerSales", [TotalSales]
)

//Then I use a filter to select only those customers whose purchases is below the 1% of Total Sales.
VAR FilterSumTable =
FILTER(SumTable , [CustomerSales] < PorcSales )

VAR TotalOthers=
CALCULATE(
[TotalSales],
FilterSumTable
)

VAR SelectOthers = SELECTEDVALUE('MY TABLE'[NAME]) = "Others"

RETURN

IF(SelectOthers,TotalOthers,[TotalSales])

 

 

 

 

What I want to achieve is to make a pie graf that shows every single customer whose purchases represent more than 1% of the total sales, the rest I want to group them under the name "others" and assign them the remaining value.

 

If I try to do a table with that information, I get this:

 

Ejemplo 1.PNG

 

As you may see, there is no "Other" row.

 

How ever, if i replace the variable with any value then yes it works.

For Example:

IF(SelectOthers,1000000,[TotalVentas])
 

 

Then Power BI "decide" to work:

ejemplo 2.PNG

 

If anybody can help me, I really appreciate it

0 REPLIES 0

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.