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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Kadd
Regular Visitor

Button to adapt visuals according to date type

Hello,

 

Hope you're all doing good.

 

I'm not used to Power BI and have to create a report based on an sharepoint list.

What i'm trying to do is having a button that will allow my visuals to switch according to column "Created" or "Modified" . so for example, i have a table containing a calendar, this table would be linked to my SharePoint list table. Then on the report, i have a slicer for the calendar and a chart that contains the number of items .... when i select a date and hit the "Modified" button, the chart should show me the number of modified items for the selected date. and when i select the button "Created" , it should show me the number of created items for the selected date.

 

it might be very simple but i'm not sure how i can link one single calendar table to 2 date values in the SP table to make this happen and then have the buttons working with this.

 

Hope it's clear enough and someone will be able to help me.

 

Thanks a lot for your time

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

You don't need buttons for that. Read about USERELATIONSHIP and the options to switch between active and inactive relationships from your Calendar table to your fact table.

View solution in original post

Anonymous
Not applicable

Hi @Kadd 

 

lbendlin has pointed out the correct direction. First please read a blog (Using USERELATIONSHIP in DAX - SQLBI) to learn about how to use the USERELATIONSHIP function in DAX. Then you can follow the steps below:

 

1. You can link the calendar table to the SP table on "Created" column and make it active. Then link the calendar table to the SP table on "Modified" and make it inactive. 

2. Then create two measures to calculate the number of items, one is a simple measure which will calculate the number of created items. The other measure uses USERELATIONSHIP function to activate the inactive relationship to calculate the number of modified items. 

3. Use a field parameter and add above two measures to it. Use the generated slicer to switch between the calculatations in the visual. Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

4. If you don't want to use field parameter in step 3, you can use bookmarks and buttons to switch between visuals. Toggle Between Charts in Power BI - Microsoft Fabric Community

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Kadd 

 

lbendlin has pointed out the correct direction. First please read a blog (Using USERELATIONSHIP in DAX - SQLBI) to learn about how to use the USERELATIONSHIP function in DAX. Then you can follow the steps below:

 

1. You can link the calendar table to the SP table on "Created" column and make it active. Then link the calendar table to the SP table on "Modified" and make it inactive. 

2. Then create two measures to calculate the number of items, one is a simple measure which will calculate the number of created items. The other measure uses USERELATIONSHIP function to activate the inactive relationship to calculate the number of modified items. 

3. Use a field parameter and add above two measures to it. Use the generated slicer to switch between the calculatations in the visual. Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

4. If you don't want to use field parameter in step 3, you can use bookmarks and buttons to switch between visuals. Toggle Between Charts in Power BI - Microsoft Fabric Community

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

 

lbendlin
Super User
Super User

You don't need buttons for that. Read about USERELATIONSHIP and the options to switch between active and inactive relationships from your Calendar table to your fact table.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors