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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kilala
Resolver I
Resolver I

Display result based on selected Category

Hi all,

In my fact table, I have Status Column which contains below:

- Open

- Partially Matched

- Matched

- Closed

I have created 5 status category using Shape as below:

 

kilala_1-1647841405431.png

Under the shapes, there would be a table. If user select "All Status", it will display all result from the table. If user click Open, it will only show records where Status = Open. 

 

How do I create measure for this?

 

Thank you.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kilala , if these are row values of a column, You can create a slicer with select all. And the Choose orientation as horizontal https://docs.microsoft.com/en-us/power-bi/power-bi-slicer-filter-responsive

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
ghoshabhijeet
Solution Supplier
Solution Supplier

@kilalaYou can use slicer instead of shapes to filter values. Also, you can skip "ALL STATUS" in the filter value if it's not required at all, since unselecting any slicer value will automatically show all data.

Presuming you will doing some calculation since your data is in fact table, I have created a sample data to answer your question. Please find below:

Data:

ghoshabhijeet_0-1647844376048.png

Showing sum of all values when no filter is selected:

ghoshabhijeet_2-1647844961519.png

Showing only values for Open status:

ghoshabhijeet_3-1647844994205.png

DAX measure used for this calculation:

Show data based on category =
IF (
SELECTEDVALUE ( Sheet1[Status] ) = "",
CALCULATE ( SUM ( Sheet1[Val] ), ALL ( Sheet1 ) ),
CALCULATE (
SUM ( Sheet1[Val] ),
FILTER ( Sheet1, Sheet1[Status] = SELECTEDVALUE ( Sheet1[Status] ) )
)
)

 

---------------------------------------------------------------------------------
** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search. Thank you !

 

 

amitchandak
Super User
Super User

@kilala , if these are row values of a column, You can create a slicer with select all. And the Choose orientation as horizontal https://docs.microsoft.com/en-us/power-bi/power-bi-slicer-filter-responsive

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.