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

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.

Reply
Parvez933
Helper I
Helper I

sumx()

Hi,

 

RetailerInvoice =
VAR bucket_min = CALCULATE(MIN('PCT-voice'[min]))
VAR bucket_max = CALCULATE(MAX('PCT-voice'[max]))
VAR total_printers = CALCULATE(DISTINCTCOUNT(Reatil[uniquekey])) return
SUMX(RetatilerMapping, VAR pct = [% Reatil] return
if(and(NOT ISBLANK(pct), and(pct > bucket_min, pct <= bucket_max)), 1)) / total_printers
 
Request your help in understanding how this DAX works, were
 
VAR bucket_min = CALCULATE(MIN('PCT-voice'[min])) ====> 0.00
 
VAR bucket_max = CALCULATE(MAX('PCT-voice'[max])) ====> 0.00
 
VAR total_printers = CALCULATE(DISTINCTCOUNT(Reatil[uniquekey])) ====> 22915
 
% Reatil ===> 1.50%
 
The result of "RetailerInvoice" is 82.15% or ~ 82%
 
I am unable to understand, how this 82% is coming based on what logic or how the last sumx() is functioning.
 
Please help
8 REPLIES 8
Parvez933
Helper I
Helper I

Hi Power BI Support Team,

 

I need to Thank @amitchandak@OliT who are trying to help here.

 

But as you see we are discussing to add some sample data here to progress which I am unable to.

 

Request your help in sharing the contex via an pbix or txt or excel or word or any other file which can help others to understand and resolve this topic.

Parvez933
Helper I
Helper I

I understand but, I am trying my best to share the sample which is not loading.

 

I am unsure about the wrong measure, as because this is being used and created long ago, which I am trying to undestand

Parvez933
Helper I
Helper I

Parvez933_0-1660198885866.pngParvez933_1-1660198912239.pngParvez933_2-1660198927167.png

 

Parvez933
Helper I
Helper I

I am unable to upload pbix or excel here, can you please help

Hi @Parvez933 

It is not possible to infer what kind of results you need to calculate only by the wrong measure above, so I need some sample data and your expected result to write the measure, you can share some screenshots or share data in text format here. 

Besides, the syntax for sumx is  SUMX(<table>, <expression>).

Usually we can write it like this, sumx(filter(table,table[column]<max&&table[column]>min),<expression>)

 

Regards,

OliT

Hi Microsoft PowerBI Team,

 

I have been awaiting your help in resolving the attachments issue, the topic is unresolved and experts are asking me to share some sample data which I am unable to share via any form of document.

 

Request your help in sharing the attachments and resolve this topic asap.

OliT
Resolver I
Resolver I

Hi @Parvez933 

This code is written incorrectly, thus getting the wrong result

OliT_0-1660120722707.png

Can you share some data, and your expected results?


Regards,

OliT

amitchandak
Super User
Super User

@Parvez933 , as you have used at table name:  RetatilerMapping

This one running for each row of the table

Check like that


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.