Forum Discussion
How to implement intersect in the Power BI?
Hi
I am having the below table (My actual table size is 1 million records with multiple dates and times)
What do I want to do?
I want to find the same date and time for all the names with values greater than 0 and the sum of the value. I just did the same in excel as below
I need a measure to sum the 4+ 6+5 = 15. Can anyone advise how to calculate this measure? So that I can use the measure and date to visualize
Can anyone tell me how to do this?
Sample pbix file here https://we.tl/t-2ancc6Zgcs
Seeif this works for you. First the model:
The measures:
Sum Value = SUM('FTable'[Value])OK Values = VAR _CR = COUNTROWS ( FILTER ( ALLEXCEPT ( 'FTable', 'Calendar Table'[dDate], 'time Table'[dTime] ), [Sum Value] <> 0 ) ) VAR _NN = CALCULATE ( DISTINCTCOUNT ( 'FTable'[Name] ), ALLSELECTED ( 'FTable' ) ) RETURN IF ( _CR = _NN, [Sum Value] )and the final measure to use in the matrix:
Final Measure = IF ( ISINSCOPE ( 'Time Table'[dTime] ), [OK Values], SUMX ( SUMMARIZE ( FTable, 'Time Table'[dTime], 'Calendar Table'[dDate] ), [OK Values] ) )To get:
I've attached the sample PBIX file
8 Replies
- ribisht17
Super User
Step 1
Concatenate Date and Time
Date and Time = 'Table'[Date]&" "&'Table'[Time]Step 2
Meassure Filter Value > 0
Step 3
Create a matrix with the new DATE column , Name in the rows and Value as MEASURE only
Regards,
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users- bourne2000
Helper V
ribisht17 Thanks. I need it as a measure. So I can visualize measure vs date. Can you help? measure should be all the sum of values with greater than 0 and same date &time
- ribisht17
Super User
Sorry that was measure only not column
- AnonymousNot applicable
You can achive by doing these two things:
1. Format the date and time from text
2. Create a measure like this and use instead of Vale.
Measure = if(sum('Table'[Value])>0,sum('Table'[Value])) - ribisht17
Super User
You can download the solution here
MATRIX CONCAT COLUMN - Google Drive and mark my answer if it helped you
- ribisht17
Super User
- PaulDBrown
Community Champion
Seeif this works for you. First the model:
The measures:
Sum Value = SUM('FTable'[Value])OK Values = VAR _CR = COUNTROWS ( FILTER ( ALLEXCEPT ( 'FTable', 'Calendar Table'[dDate], 'time Table'[dTime] ), [Sum Value] <> 0 ) ) VAR _NN = CALCULATE ( DISTINCTCOUNT ( 'FTable'[Name] ), ALLSELECTED ( 'FTable' ) ) RETURN IF ( _CR = _NN, [Sum Value] )and the final measure to use in the matrix:
Final Measure = IF ( ISINSCOPE ( 'Time Table'[dTime] ), [OK Values], SUMX ( SUMMARIZE ( FTable, 'Time Table'[dTime], 'Calendar Table'[dDate] ), [OK Values] ) )To get:
I've attached the sample PBIX file