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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Aidenfry
Frequent Visitor

Measures insert into 2D table

Hi All,

 

I have a bunch of measures, which are fairly complex in creation.

i.e. Perform maths on a table, selecting certain rows / values to create travel times based on a bunch of average speeds.

 

Now I have 6 Measures (will be more soon), Road 1 Travel Time By Car, Road 1 Travel Time By Cycle, Road 1 Travel Time By Walk, Road 2 Travel Time By Car, Road 2 Travel Time By Cycle, Road 2 Travel Time By Walk.

 

I want to be able to show them in a 2D table / matrix + a label for the road name.

 

Road Name, Car Travel Time, Cycle Travel Time, Walk Travel Time

Road 1       , 5 mins             ,   8 mins                 , 19 mins

Road 2      , 4 mins               , 7 mins                 , 15 mins

 

My Issue is that I cant seem to visualise / group my measures into rows, when i am adding them to tables / matrixs they end up in one long row.

 

Any help would be appreciated.

 

I am thinking i might want to:

- import my measures into a new source table so I can group them by rows,

- Use a visualisation tool which i havent found which allows me to display the measure where I want in a table view.

 

As a back up i can use a bunch of cards and place them where I want, but this looses the ability to scroll.

 

Thanks for your help,

Aiden

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Probably use a variation of the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...

 

So, have your Roads in a table, use that for your rows. Create a measure using your existing measures and SWITCH to determine which measure to show.

 

Very difficult to be precise without sample data, etc. 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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Probably use a variation of the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...

 

So, have your Roads in a table, use that for your rows. Create a measure using your existing measures and SWITCH to determine which measure to show.

 

Very difficult to be precise without sample data, etc. 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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Perfect thanks,

 

Knew it would be fairly easy once i found the right key word!

 

My code for the car column

 

Car Travel Time =
IF(
// This first IF condition forces the measure to evaluate in the context of the visual
    HASONEVALUE(roadnames[Roads]),
// This next condition avoids getting the error that the visual cannot be displayed
        IF(HASONEVALUE(roadnames[Roads]),
// This switch statement uses the values from our Attendance slicer to determine which measure to display
            SWITCH(
          VALUES(roadnames[Roads]),
          "Botley Road",[Botley Car],
          "Iffley Road",[Iffley Car]
                ),
// If the Attendance slicer has not been selected, just display the date of the training
            "-"
        )
, "-")
Super easy, NOTE that the example given doesnt have the false result for the first if so i had to add that simply enough for me was to have a dash.

 

BR,

Aiden

Awesome!

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors