cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BDA2 Member
Member

Dax Measure for Range

Hi Any DAX Expertise Here?

 

My Access Count is a count column from my data source.

May I ask any DAX measure that I can use to filter out

 

Access Count >10

Access Count <0

Access Count >5 & <10

Access Count >0 & <5 

 

Access Count.jpg

 

Let me know if you have any questions.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xicai Super Contributor
Super Contributor

Re: Dax Measure for Range

Hi @BDA2 ,

 

You can create Range table via "Enter Data" under Home ribbon.

2.png

 

 

 

 

Then create column Range Judge to judge range, or you may create column Range Judge1 which won't need the Range table.

 

 

Range Judge = CALCULATE(VALUES(Range[Access Count range]),FILTER(Range,Table1[Access Count]>=Range[Min]&&Table1[Access Count]<=Range[Max]))

 

Range Judge1 = SWITCH(TRUE(),Table1[Access Count]<=0,"Count of Login <= 0",Table1[Access Count]>0&&Table1[Access Count]<=5,"Count of Login > 0 & <= 5",Table1[Access Count]>5&&Table1[Access Count]<=10,"Count of Login >5 & <= 10",Table1[Access Count]>10,"Count of Login >10")

 

 

3.png

 

 

 

 

Here is my test pbix: https://community.powerbi.com/t5/Desktop/Dax-Measure-for-Range/m-p/689458#M332430

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

9 REPLIES 9
Super User
Super User

Re: Dax Measure for Range

Hey,

maybe this article is what you are looking for: https://www.daxpatterns.com/static-segmentation/

There is also an article about dynamic segmentation if the above does not provide what you need.

Regards,
Tom
Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
BDA2 Member
Member

Re: Dax Measure for Range

Hi @TomMartens 

 

I follow the guideline but no result is showing

 

Range = CALCULATE(VALUES(Query1[Access Count]), FILTER(Query1, Query1[Access Count]>=10 && Query1[Access Count]<=0))
 
The DAX has no error
 
 
Super User
Super User

Re: Dax Measure for Range

Hey,

please prepare a pbix file that contains sample data and reflects your data model, upload the to onedrive or dropbox and share the link.

Regards,
Tom
Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
BDA2 Member
Member

Re: Dax Measure for Range

Hi @TomMartens 

 

Can you send me your email instead?

 

My source file and access are confidential and restricted.

 

I will revise the source file and send to you.

Super User
Super User

Re: Dax Measure for Range

Hey,

confidential data is exactly the reason why I'm asking for sample data 😉

Regards,
Tom
Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
BDA2 Member
Member

Re: Dax Measure for Range

 

Hi @TomMartens 

 

Here is the sample data, can you import into your PowerBI and share me the Dax ,

 

Filter by Count of Login >10

Count of Login < 0

Count of Login >5 & < 10

Count of Login > 0 & < 5

 

UserTime of Login
A1/1/2015
A2/1/2015
B3/1/2015
B4/1/2015
B5/1/2015
C6/1/2015
D7/1/2015
D8/1/2015
D9/1/2015
D10/1/2015
D11/1/2015
A12/1/2015
A13/1/2015
A14/1/2015
B15/1/2015
C16/1/2015
C17/1/2015
C18/1/2015
C19/1/2015
D20/1/2015
D21/1/2015
v-xicai Super Contributor
Super Contributor

Re: Dax Measure for Range

Hi @BDA2 ,

 

You can create Range table via "Enter Data" under Home ribbon.

2.png

 

 

 

 

Then create column Range Judge to judge range, or you may create column Range Judge1 which won't need the Range table.

 

 

Range Judge = CALCULATE(VALUES(Range[Access Count range]),FILTER(Range,Table1[Access Count]>=Range[Min]&&Table1[Access Count]<=Range[Max]))

 

Range Judge1 = SWITCH(TRUE(),Table1[Access Count]<=0,"Count of Login <= 0",Table1[Access Count]>0&&Table1[Access Count]<=5,"Count of Login > 0 & <= 5",Table1[Access Count]>5&&Table1[Access Count]<=10,"Count of Login >5 & <= 10",Table1[Access Count]>10,"Count of Login >10")

 

 

3.png

 

 

 

 

Here is my test pbix: https://community.powerbi.com/t5/Desktop/Dax-Measure-for-Range/m-p/689458#M332430

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

v-xicai Super Contributor
Super Contributor

Re: Dax Measure for Range

Hi  @BDA2 ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case.

 

Best regards

Amy Cai

BDA2 Member
Member

Re: Dax Measure for Range

Hello Amy,

 

It works. This is great !!.

 

Thank you so much.