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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dax Power BI help to filter based on 2 columns

Hello All,

 

I've SQL data as:-

CREATE TABLE #Temp1 ( app_dt date, borr_type varchar(10) )
CREATE TABLE #Temp2 ( app_dt date, borr_type varchar(10), mt smallint )

INSERT INTO #Temp1 VALUES ( '2020-11-01', 'Nw' )
INSERT INTO #Temp1 VALUES ( '2020-11-01', 'Pr' )
INSERT INTO #Temp1 VALUES ( '2020-11-01', 'Fr' )
INSERT INTO #Temp1 VALUES ( '2020-12-01', 'Nw' )
INSERT INTO #Temp1 VALUES ( '2020-12-01', 'Pr' )

INSERT INTO #Temp2 VALUES ( '2020-11-01', 'Nw', 123 )
INSERT INTO #Temp2 VALUES ( '2020-11-01', 'Pr', 456 )
INSERT INTO #Temp2 VALUES ( '2020-11-01', 'Fr', 789 )
INSERT INTO #Temp2 VALUES ( '2020-12-01', 'Nw', 147 )
INSERT INTO #Temp2 VALUES ( '2020-12-01', 'Pr', 258 )

SELECT	*
FROM	#Temp1

SELECT	*
FROM	#Temp2

DROP TABLE #Temp1
DROP TABLE #Temp2

 

Join is between app_dt between these 2 tables under model.

 

Now I want to display Matrix visual which is build from the #Temp2 to filter based on the borr_type. Borr_type (3 distinct values) is the hierartical slicer.

 

Need your help to with DAX query.

 

TIA

 

Regards,

gk03

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Ideally both table should be joined with date table and common borr_type type table .They should not join

 

create borr_type 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Try to be in star schema -https://www.sqlbi.com/articles/the-importance-of-star-schemas-in-power-bi/

Anonymous
Not applicable

@amitchandak here is my sample .pbix file link,

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


Let me know how to connect below borr_nm slicer with the Matrix visual?

kaumilgandhi_0-1620363835221.png


TIA

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors