cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors