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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
armonz
Frequent Visitor

Filter columns for a simple table based on the first value of each column

I need to filter the columns of a table based on the first value of each column. Each of these columns have a variety of values inside them but the first value is always a date, based on a date filter I'd like to filter out the columns whose dates do not match with the selected value on the filter.

 

 image.png

 

The expected result would be that columns 4, 5 & 6 only show up when the selected date is December 2023. 

Thank you in advance.

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @armonz ,

With the information available, it would be difficult to achieve your results. I would still recommend that you apply slicer after transposing in Power Query, which will put the date into a column.
Here is my sample data:

vjunyantmsft_0-1707121468584.png
vjunyantmsft_2-1707121533121.png
After transpose:

vjunyantmsft_1-1707121524797.png

Then I create this measure:

 

Measure = 
IF(
    YEAR(MAX(Transpose[Column1])) = SELECTEDVALUE(Slicer_Year[Year]) && MONTH(MAX('Transpose'[Column1])) = SELECTEDVALUE(Slicer_Month[Month]),
    1,
    0
)

 

Put this into the "Filters on this visuals":

vjunyantmsft_3-1707121635036.png

And set it as this way:

vjunyantmsft_4-1707121723356.png

The final output is as below:

vjunyantmsft_5-1707121759496.png


And there is another way. However, this method was only tried on a small portion of the data.
For example:
Create bookmarks for these table visuals:

vjunyantmsft_9-1707122120032.png

vjunyantmsft_7-1707122084527.png

vjunyantmsft_8-1707122098169.png

Create buttons for each bookmark:

vjunyantmsft_10-1707122175424.png

Please refer to this post for the exact steps:
Solved: chart type change on published bookmarks - Microsoft Fabric Community

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

View solution in original post

3 REPLIES 3
v-junyant-msft
Community Support
Community Support

Hi @armonz ,

With the information available, it would be difficult to achieve your results. I would still recommend that you apply slicer after transposing in Power Query, which will put the date into a column.
Here is my sample data:

vjunyantmsft_0-1707121468584.png
vjunyantmsft_2-1707121533121.png
After transpose:

vjunyantmsft_1-1707121524797.png

Then I create this measure:

 

Measure = 
IF(
    YEAR(MAX(Transpose[Column1])) = SELECTEDVALUE(Slicer_Year[Year]) && MONTH(MAX('Transpose'[Column1])) = SELECTEDVALUE(Slicer_Month[Month]),
    1,
    0
)

 

Put this into the "Filters on this visuals":

vjunyantmsft_3-1707121635036.png

And set it as this way:

vjunyantmsft_4-1707121723356.png

The final output is as below:

vjunyantmsft_5-1707121759496.png


And there is another way. However, this method was only tried on a small portion of the data.
For example:
Create bookmarks for these table visuals:

vjunyantmsft_9-1707122120032.png

vjunyantmsft_7-1707122084527.png

vjunyantmsft_8-1707122098169.png

Create buttons for each bookmark:

vjunyantmsft_10-1707122175424.png

Please refer to this post for the exact steps:
Solved: chart type change on published bookmarks - Microsoft Fabric Community

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

Thanks, couldn't get the expected result, but this got me the closest to it. 

TomMartens
Super User
Super User

Hey @armonz ,

 

a well-defined semantic model (okay, sometimes a model is enough) is the foundation of simple but powerful data analysis using Power BI for this reason I recommend these two articles:

Next to that, it will help us to understand your requirement way more better if you provide sample data, ideally in pbix file that represents your data model (tables, relationships, calculated columns, and measures) that we can dwnload from OneDrive, Google Drive, or dropbox.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.