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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
EACruz
Frequent Visitor

Creating a Dimension that is dependent on Parameter Selected

Hello,
I am transitioning from Tableau to Power BI and am Struggling finding DAX Expressions that allow the rows/columns in a Matrix to adjust based on the parameter selection. In Tableau this was a simple task because I could just write the calculated field below.

Aging Days

if [Aging Parameter] = "DOS Aging" Then [DOS Aging]

elseif [Aging Parameter] = "Denial Aging" then [Denial Aging]

END

Aging Group

CASE [Aging Days]

WHEN "000 - 030" THEN "000 - 090"

WHEN "031 - 060" THEN "000 - 090"

WHEN "061 - 090" THEN "000 - 090"

ELSE "091 +"

END

 

How can I create a new Column that groups the days based on the Parameter Selection in a Matrix? No Matter which Aging Parameter is selected the Grouping is the same but the Aging Days will vary based on which selection is made (DOS or Denials).

Thank You in advance for your help!

EACruz_0-1738370614698.png

 

 

 

3 REPLIES 3
rohit1991
Super User
Super User

Hi, @EACruz ,
Here's how to achieve dynamic aging groups in Power BI using DAX:

  1. Create a Parameter Table (Disconnected Table) : AgingParameter = DATATABLE("Aging Selection", STRING, { "DOS Aging", "Denial Aging" })

  2. Capture Selected Parameter:
    SelectedAging = SELECTEDVALUE(AgingParameter[Aging Selection], "DOS Aging")
  3. Define Aging Days Based on Selection:
    AgingDays = SWITCH([SelectedAging], "DOS Aging", SELECTEDVALUE('YourTable'[DOS Aging]), "Denial Aging", SELECTEDVALUE('YourTable'[Denial Aging]))

  4. Create Aging Group Logic: AgingGroup:
    AgingGroup = SWITCH(TRUE(), [AgingDays] IN {"000 - 030", "031 - 060", "061 - 090"}, "000 - 090","091 +")

  5. Use in Matrix Visual

    • Place AgingGroup in Rows.
    • Use measure values in Values.
    • Add AgingParameter[Aging Selection] as a slicer.

 

 

 

Hi @rohit1991 ,
I appreciate the detailed explanation! I was able to reacreate all of the Fields as you mentioned above.

The only challenge with 'Aging Days' is that if we use the SELECTEDVALUE function then we are expecting to see One Distinct Value but as shown below 'DOS Aging' and 'Denial Aging' has a list of Values. I wanted to use it as a Dimension to toggle between one and the other without the addition of another Parameter. In other words, 'Aging Selection' should allow me to switch between 'DOS Aging' and 'Denial Aging' Dimensions.

EACruz_0-1738717741411.png

 

lbendlin
Super User
Super User

read about Field Parameters, that's the closest you can get to that.

Use report readers to change visuals (preview) - Power BI | Microsoft Learn

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors