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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
laciodrom_80
Helper IV
Helper IV

DAX expression, need suggestion

Hi all,

 

I have theese two tables with no relationship:

 

Table1                                            Table2

 

table1.pngtable2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I have calculated Max and Min measures for the Value column and the measure IntervalGap which is Max-Min/15

 

 

Max = MAX(Table1[Value])

Min = MIN(Table1[Value])

IntervalGap= (Max-Min)/15

I would like to count how many values of Value column (Table1) belong to each of 15 intervals (from Min to Max with step IntervalGap) creating a measure or a calculated column to add in table2 where in the Index column are listed the fifteen intervals

 

Index column 1 represents the interval from Min to Min+IntervalGap

Index column 2 represents the interval from Min+IntervalGap to Min+2*IntervalGap

...

 

How can I achieve this goal with a DAX expression?

 

Thanks in advance for any clue!

Luca
1 ACCEPTED SOLUTION

OK, here is what I am thinking in Table2:

 

Column = 
VAR __low = IF([Index]=1,[MinMeasure],[MinMeasure]+([Index]-1)*[IntervalGapMeasure])
VAR __high= IF([Index]=15,[MaxMeasure],[MinMeasure]+[Index]*[IntervalGapMeasure])
RETURN
COUNTX(FILTER('Table1',[Value]>=__low && [Value]<=__high),[Scenario Number])

May need tweaking but something along these lines I believe.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

I'm also a little bit lost reading your post.

Can you provide sample data?

 

Greg_Deckler
Community Champion
Community Champion

Not really following this. Sample data that can be copied and pasted always helps. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490. What is the relationship between those two tables?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler I've edited original post trying to be clearer.

 

No relationships between two tables

Luca

OK, here is what I am thinking in Table2:

 

Column = 
VAR __low = IF([Index]=1,[MinMeasure],[MinMeasure]+([Index]-1)*[IntervalGapMeasure])
VAR __high= IF([Index]=15,[MaxMeasure],[MinMeasure]+[Index]*[IntervalGapMeasure])
RETURN
COUNTX(FILTER('Table1',[Value]>=__low && [Value]<=__high),[Scenario Number])

May need tweaking but something along these lines I believe.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

 

@Greg_Deckler

 

I was trying to make the report more configurable adding a filter by date column which is in Table1: changing date selection in the filter I'd like to have the updated values in the calculated column of Table2: how can I achieve this goal? I need a measure, right?

 

Thanks a lot

Luca

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors