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
paybacksilver
Frequent Visitor

Variable Tables in Measures

Hello, another question for today:

 

paybacksilver_0-1651692147598.png

(CY in the last row is a typo that has since been corrected.)

I have made a measure alongside a measure table that allows me to filter my sheet by a selected measure, of which I have seven. 

paybacksilver_1-1651692206117.png

 

 

However, in the interest of keeping this entire report to one page, I also want the ability to select a specific date range to compare against. To make the measures easy, I created six tables, three of which are compared against the other three from the year, week, or day prior:

paybacksilver_2-1651692339550.png

 

My goal here is to have another metric switcher, for Day, Week, and Year. I thought the easiest way to do this was to have parameters within the original measure to change the "LY" to "LD" or "LW" to access the respective metrics from each date range, with the ability to select the date range as I would select my metrics in the filter I have already built. 

 

 

If there is a way to do this, or an easier way to get to my end result, any help is appreciated!

 

 

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

Hi @paybacksilver ,

You can refer the following links to get it:

Dynamic Selection of Measures in Power BI

1. Create a measure dimension table as below
yingyinr_0-1652082377934.png
2. Create different measures  base on different period(CD,CW,CY, LD,LW and LY etc.) calculation logic

Invoiced Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Invoiced Amount"), SUM(KPI_BBB_FACT[INVOICED_AMOUNT]), BLANK())

Discount Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Discount Amount"), SUM(KPI_BBB_FACT[DISCOUNT_AMOUNT]), BLANK())

Cancel Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Cancel Amount"), SUM(KPI_BBB_FACT[CANCEL_AMOUNT]), BLANK())​


CREATING DYNAMIC MEASURES FOR POWER BI VISUALIZATIONS

Change time period (week, Month, Quarter...) on slicer selection

yingyinr_1-1652082525290.png

Best Regards

Community Support Team _ Rena
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

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @paybacksilver ,

You can refer the following links to get it:

Dynamic Selection of Measures in Power BI

1. Create a measure dimension table as below
yingyinr_0-1652082377934.png
2. Create different measures  base on different period(CD,CW,CY, LD,LW and LY etc.) calculation logic

Invoiced Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Invoiced Amount"), SUM(KPI_BBB_FACT[INVOICED_AMOUNT]), BLANK())

Discount Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Discount Amount"), SUM(KPI_BBB_FACT[DISCOUNT_AMOUNT]), BLANK())

Cancel Amount = IF(CONTAINS('Measures 1','Measures 1'[Measure], "Cancel Amount"), SUM(KPI_BBB_FACT[CANCEL_AMOUNT]), BLANK())​


CREATING DYNAMIC MEASURES FOR POWER BI VISUALIZATIONS

Change time period (week, Month, Quarter...) on slicer selection

yingyinr_1-1652082525290.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.