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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Create a custom Table

Hello All,

 

Please me with a DAx to create a new Table with an existing DATASET with Filter.

image.png

I need to carete a New table With columns Products and Amounts with Blanks. Result 

 

image.png

 

REgards,

1 ACCEPTED SOLUTION

@Anonymous try this DAX formula, I blindly followed what you explained.

 

Result = 
VAR __table = SUMMARIZE( SetB, SetB[Product], SetB[Region], "Sales", SUM( SetB[Sales] ) ) 
RETURN
UNION(
INTERSECT( SetA, SUMMARIZE( FILTER( __table, [Sales]= 0 ), [Product], [Region] )),
EXCEPT( SUMMARIZE( FILTER( __table, [Sales]= 0 ), [Product], [Region] ), SetA )
)

here is the output of result table

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
Naveen_SV
Helper IV
Helper IV

Hi ,

 

you can try out in the below way.

Try to create a column where you can assign which has value or Null Value in Table 1

Column = IF(Table1[Amount]=BLANK(),0,Table1[Amount])
Then in your table 2 Create a unique (or distinct) "product" Values. Create a measure 
Measure = CALCULATE(SUM(Table1[Column]),IF(Table1[Column]=0,1,0),CROSSFILTER(Table1[Product],Table2[Product],Both))
you will be able to saperate product which is showing 0 or Null.1.PNG2.PNG3.PNG
 

sktneer
Resolver I
Resolver I

Assuming the name of the Table is Sales, then you can create a New Table like below...

 

Sales Table With Zero Amount 
= FILTER(
    Sales,
    Sales[Amount]=0
)

 

Edit:

And if you just want to have only two columns Product and Amount in the New Table, try it like this...

 

Products With Zero Sales
= FILTER(
    ALL(
        Sales[Product],
        Sales[Amount]
        ),
    Sales[Amount]=0
)
Anonymous
Not applicable

Hi,

Let me explain in detail about the requirement.

I have 2 datasets A & B A is primary Set9 Unique Values and B is a Normal data. I need to find the odd values from B by comparing the values with SetA.

Exap:

1.The Result is to get the Region with Zero sales and the region should be in SETA.

Exaple, Product A with Sales 0 In Florida should be excluded. only Products with Region exists in SET A should apprear.

Only Zero sales Region with product should be tracked.

Please check the clienk for your reference.

https://drive.google.com/file/d/1JhAEHlYQGAJUaJ7v3KrSZbLFLt6lC3Yx/view?usp=sharing

 

Please let me know if you need further details,

 

REgards,

 

 

Regards.

That's a completely different requirement altogether.

Look at your first two posts, you also provided a sample dataset in your second post and none of those two posts had any clue about this requirement at all.

What's the point in not adding that detail in your original post at the first place?

Anonymous
Not applicable

Sorry, wish to try from this, but dint find any clue on this. 

 

Appreciate your Hep help.

@Anonymous try this DAX formula, I blindly followed what you explained.

 

Result = 
VAR __table = SUMMARIZE( SetB, SetB[Product], SetB[Region], "Sales", SUM( SetB[Sales] ) ) 
RETURN
UNION(
INTERSECT( SetA, SUMMARIZE( FILTER( __table, [Sales]= 0 ), [Product], [Region] )),
EXCEPT( SUMMARIZE( FILTER( __table, [Sales]= 0 ), [Product], [Region] ), SetA )
)

here is the output of result table

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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