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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Alexxci
New Member

Filter multiple columns and use a list of values

Hi,

 

I'm currently facing and issue that I cannot resolve and I hope that someone can bring some light to the problem:

I have the following dataset where each Date matches a code, for both dates (Start and End share the same code): Captura.PNG

 

The requirement is to select a code (Which includes the start and end codes) and return the total count of active parts before the date associated for each description (Active part means that it does not have an end date prior to the associated code date).
Example -> If the user selects the code "C2" I need to return all the active parts for each description prior to the related date for the code selected which is 17/02/2021:
Description A: 3
Description B: 3
Description C: 1

Kind Regards,
Alex

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @Alexxci ,

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
var _1=SUMMARIZE('Table',[Part],[Description],[StartDate],[EndDate],[Code Start])
var _2=SUMMARIZE('Table',[Part],[Description],[StartDate],[EndDate],[Code End])
return
UNION(_1,_2)

2. Create measure.

Measure =
var _selected=MAX('Table 2'[StartDate])
return
IF(MAX('Table'[Column])<=_selected,1,0)
Measure2 =
var _table=SUMMARIZE('Table',[Part],[Description],"1",[Measure])
return
SUMX(_table,[1])
Measure2 =
var _table=SUMMARIZE('Table',[Part],[Description],"1",[Measure])
return
SUMX(_table,[1])

3. Put [Code Start] in Table2 into the slicer

vyangliumsft_0-1632812305204.png

4. Place [Flag] in the Filter and set is = 1.

vyangliumsft_1-1632812305219.png

5. Result:

vyangliumsft_2-1632812305221.png

I still don’t know the result of this B. According to logic, these five are all possible.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks for your help!

It's close but the key part is that the Result always depends based on which Date the user selects.
So if the user select 17/02/2021 it has to show all the possible values that have a Start Date prior to this date (Not included) that doesn't contain an End Date prior to this date

Greg_Deckler
Super User
Super User

@Alexxci Why is B 3?

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Actually I made a mistake, the total count should be:
Description A = 3
Description B = 3
Description C = 1

The total count of parts for the Description B that matches the requirement
When the user selects the code C2 it has 3 distinct Description values that contains either in the Code Start or Code End column this code. Then We need to count how many rows have a Start date prior to 17/02/2021 and doesn't have an End Date also prior to 17/02/2021.
Captura.PNG

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.