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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
varelapablo90
Helper II
Helper II

Help - Dax Threshold

Hello everyone

 

I need help with the following case.

I would like to know from my main raw data table how many of these invoices are under 50, how many under 100 (including the <50.... and so on 200, 300, etc.

Is there any possible way to create a table with a such information?

Currently I have my Threshold table with the values you see in the screen relationed to the main table on the Invoice Value field.

 

How could this be achieved?

 

varelapablo90_1-1648198679455.png

 

 

1 ACCEPTED SOLUTION

@varelapablo90 Try with this calculated column in the Threshold Table:

 

Colonna =
VAR THRE = Threshold[Threshold]
RETURN CALCULATE(COUNTROWS(T_RawData_Azure),T_RawData_Azure[Amount_in_EUR] <= THRE)
 
It returns the count of amount value in T_RawData_Azure that are less or equal to that threshold, like this:
BeaBF_0-1648200346534.png

 

B.

View solution in original post

9 REPLIES 9
BeaBF
Super User
Super User

@varelapablo90 can you paste your invoice value field?

 

Thx,

B.

Like this? These fields are in my main raw data table T_RawData_Azure

varelapablo90_1-1648199889980.png

 

@varelapablo90 Try with this calculated column in the Threshold Table:

 

Colonna =
VAR THRE = Threshold[Threshold]
RETURN CALCULATE(COUNTROWS(T_RawData_Azure),T_RawData_Azure[Amount_in_EUR] <= THRE)
 
It returns the count of amount value in T_RawData_Azure that are less or equal to that threshold, like this:
BeaBF_0-1648200346534.png

 

B.

I thought it had worked but now that I see it didnt, I have like 4 million rows in this set, numbers should be bigger, but also for example the Category 100 should include the 50. What be wrong?

varelapablo90_0-1648202282072.png

 

@varelapablo90  both threshold and amount are numbers?

 

Can you make an example with a subset? It seems very strange... 

 

B.

What do you mean with a subset? 

I cant figure out what is different from the solution you provided, the datatypes are both numbers and the relationship is based on Amount_in_EUR -> Threshold

@varelapablo90 the relationship is useless, try to remove it. By subset I mean taking a piece of data to understand why it doesn't work, to me it works with the data I pasted to you.

 

Try with Count instead of Countrows:

Colonna =
VAR THRE = Threshold[Threshold]
RETURN CALCULATE(COUNT(T_RawData_Azure[Amount_in_EUR]),T_RawData_Azure[Amount_in_EUR] <= THRE)

 

B.

Got solved when deleting the relationship :S

 

Thank you very much

Worked perfectly, thank you!

What if I want to also have the column with the values in eur too? 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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