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
MyPI
Regular Visitor

How to select a subset of a table by a Date Slicer and then group it twice by multiple columns?

Input Table1

Table1.PNG

Use a Date slicer to pick up the date range from 11/29/2022 to 11/30/2022 get Table 2:

Table2.PNG

 

Calculate the Total_Availability_By_Group by groupping the Product_Name, Product_Type and Availability_Type to get Table 3:

Table3.PNG

 

Finally, calculate the IB-OB by groupping the Product_Name and the Product_Type to get Table 4:

Table4.PNG
Any idea how to get the IB-OB or the Table 4 with Dax functions? Thank you!

2 REPLIES 2
wdx223_Daniel
Super User
Super User

put Product_Name and Product_Type on the rows and try this measure

IB-OB=CALCULATE(SUM(Table[Availablity]),Table[Availability_Type]="IB")-CALCULATE(SUM(Table[Availablity]),Table[Availability_Type]="OB")

Hi wdx223_Daniel,


Thank you for your suggestion.

However, all I have is the input Table 1, whereas the Table 2, Table 3 and Table 4 are just virtual tables which are assume to be obtained after the processing specified at each step. What I would like to know is:
1. how to get Table 2 from Table 1 with dax function?

2. how to get Table 3 from Table 2 with dax function?

3. how to get Table 4 from Table 3 with dax function?


In other words, what is the right dax function to get the IB-OB from Table?

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.