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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
hemann
Helper I
Helper I

DAX query combining data

Hi, I am trying to create the below visual. I have two pieces of data that I need to combine to get the correct results (Data 1 & Data 2). I am ideally looking to create a DAX query to achieve this. I have created a third piece of data, which is the result needed. Can somebody please help with a neat measure!!

hemann_0-1661833157867.png

Data1

hemann_1-1661833204823.png

Data2

hemann_2-1661833233870.png

Data Result

hemann_3-1661833273334.png

 

 

1 ACCEPTED SOLUTION

I tweaked the solution to return a volume of 1 for all records. This was more or less the solution I was looking for, thanks for your help with it. 

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below DAX formula and the attached pbix file.

It is for creating a new table.

 

Result table =
VAR _newtable =
    CROSSJOIN ( VALUES ( Data[Feature] ), VALUES ( 'Product'[Product] ) )
VAR _addcolumns =
    ADDCOLUMNS (
        _newtable,
        "@Result",
            IF (
                COUNTROWS (
                    FILTER (
                        Data,
                        Data[Feature] = EARLIER ( Data[Feature] )
                            && Data[Product] = EARLIER ( 'Product'[Product] )
                    )
                ) <> 0,
                MAXX (
                    FILTER ( 'Product', 'Product'[Product] = EARLIER ( 'Product'[Product] ) ),
                    'Product'[Material]
                ),
                "No Material"
            ),
        "@Volume",
            MAXX (
                FILTER (
                    Data,
                    Data[Feature] = EARLIER ( Data[Feature] )
                        && Data[Product] = EARLIER ( 'Product'[Product] )
                ),
                Data[Volume]
            ) + 0
    )
RETURN
    _addcolumns

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

I tweaked the solution to return a volume of 1 for all records. This was more or less the solution I was looking for, thanks for your help with it. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.