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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DaxCoffee
Regular Visitor

Store a table as measure

Hi,

 

Is there a way to create/use a measure as a table. Let me explain by using an example:

 

I want to sort pictures in colour and Black&White. Instead of putting all the information in one measure like this:

 

ColorOrBW =

   VAR

      PictureTableGrouped = ADDCOLUMNS(

         PictureTable,

         "TypeOfPicture",

         if(PictureTable[MainColour] in

            {"black","grey","white"},

            "BW",

            "Colour")

   RETURN

      PictureTableGrouped

 

 

Bur instead of listing the colours (black, grey, white) within the measure I would rather have them as a separate measure, like this.

 

Measure with all the colours within one grup, like this:

 

Black_White = {"Black","Grey","White"}

 

...and then use this

 

ColorOrBW =

   VAR

      PictureTableGrouped = ADDCOLUMNS(

         PictureTable,

         "TypeOfPicture",

         if(PictureTable[MainColour] in Black_White,

            "BW",

            "Colour")

   RETURN

      PictureTableGrouped

 

 

PS! I've tried to make the "table-measure" like this (but it did not work - could also be that I've did not use it correctly in the main measure (ColorOrBW). Here is how I made the "table-measure":

 

Black_White = DATATABLE("Black_White_Colours",STRING,{{"Black","Grey","White"}})

 

Thank you for all help in advance!

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Simple answer: YOU CANNOT RETURN TABLES FROM MEASURES.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Simple answer: YOU CANNOT RETURN TABLES FROM MEASURES.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.