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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abhiram342
Microsoft Employee
Microsoft Employee

Help on Treatas DAX Code

Hi All,

 

I want to create measure for below scenario but not working as expected. Can someone please assist?

 

Scenario:

I want to get distinct Products with either no internet sales or Offline sales

EX:

In Internet sales: 2,4 ( productID)

In Offline Sales :2,3 (ProductID)

Final Measure: 2,3,4 ( Unique product from Internet and Offline Sales

DimProduct:

ProductIdProductName
1Bike
2Car
3Bi-Cycles

FactInternetSales

ProductIdSalesAmount
110
20
350
40

FactOfflineSales

ProductIdSalesAmount
110
20
30
410

 

Thanks,

Abhiram

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @abhiram342 

Please correct me if I wrongly understood your question.

I assume you want to create a new table.

please try the below for creating a new table.

 

Picture2.png

 

new table =
DISTINCT (
UNION (
SUMMARIZE (
FILTER ( InternetSales, InternetSales[SalesAmount] = 0 ),
InternetSales[ProductId]
),
SUMMARIZE (
FILTER ( OfflineSales, OfflineSales[SalesAmount] = 0 ),
OfflineSales[ProductId]
)
)
)
 

Hi, My name is Jihwan Kim.


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


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


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

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@abhiram342 , Create a measure like

 

new measure =Sum(FactInternetSales[SalesAmount]) + Sum(FactOfflineSales[SalesAmount])

 

Then create this measure 

check measure =
calculate( if( isblank([new measure]),1,blank()))

 

or


check measure =
countx(values(DimProduct[ProductId] ) if( isblank([new measure]),[ProductId],blank()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.