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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Aydan_Abdul
New Member

DAX

Hi,everyone! I have DAX problem.

I have frequecy table.
My input table is this.
id                freq_min    freq_max
136
1610
11018
11820
12123
235
2510
21113

I want this:
 id            freq_min      freq_max
1320
12123
2310
21113
3-6 ; 6-10; 10-18; 18-20 ---》2-20
They are ranges and I combine ranges.

With loves

2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @Aydan_Abdul,

 

Can you please try this:

CombinedRanges = 
VAR SortedTable = SUMMARIZE(FrequencyTable, FrequencyTable[id], FrequencyTable[freq_min], FrequencyTable[freq_max])
RETURN
GENERATE(
   DISTINCT(SortedTable[id]),
   ADDCOLUMNS(
      FILTER(SortedTable, [id] = EARLIER([id])),
      "CombinedFreqRange",
      IF(
         EARLIER(SortedTable[freq_max]) >= SortedTable[freq_min],
         MAXX(FILTER(SortedTable, [id] = EARLIER([id]) && EARLIER(SortedTable)[freq_max] >= SortedTable[freq_min]), SortedTable[freq_max]),
         SortedTable[freq_max]
      )
   )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Syntax is wrong. Thanks a lot!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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