Forum Discussion
SLICER AS A FILTER FOR DATA TABLE
- 6 years ago
Hi JOKA ,
We can create a measure to meet your requirement.
1. Create the relationships like following screenshot.
2. Then we can create a measure like this,
Indicator Total correct = IF ( HASONEFILTER ( 'Fact Table'[Date] ) || HASONEFILTER ( 'Table'[Date] ), SUM ( 'Fact Table'[Metric] ) * SUM ( 'Table'[Ratio] ), SUMX ( SUMMARIZE ( 'Fact Table', 'Fact Table'[Date], 'Fact Table'[Metric], "product", 'Fact Table'[Metric] * CALCULATE(SUM('Table'[Ratio])) ), [product] ) )If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
JOKA , not very clear to me but can YTD help
Example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Thank you for your response! I appreciate it.
Let me give you an example to explain a bit more the problem:
These are the tables I have
In the dashboard I have a slicer that uses the field Date in Calendar Table. If I select August in the slicer, I want to see this:
| Date | Indicator |
| Jan-20 | 1626 |
| Feb-20 | 1292,4 |
| Mar-20 | 1391 |
| Apr-20 | 954 |
| May-20 | 1050 |
| Jun-20 | 916,7 |
| Jul-20 | 1224 |
| Aug-20 | 1600 |
the formula = Metric x Ratio
where Date Analysis = Aug-20
I´m attaching an excel file with the example here:
https://drive.google.com/file/d/1jgJvsV-QVb42bl3VIi_aFXUjQj-Jk_2u/view?usp=sharing
- v-zhenbw-msft6 years agoCommunity Support
Hi JOKA ,
We can create a measure to meet your requirement.
1. Create the relationships like following screenshot.
2. Then we can create a measure like this,
Indicator Total correct = IF ( HASONEFILTER ( 'Fact Table'[Date] ) || HASONEFILTER ( 'Table'[Date] ), SUM ( 'Fact Table'[Metric] ) * SUM ( 'Table'[Ratio] ), SUMX ( SUMMARIZE ( 'Fact Table', 'Fact Table'[Date], 'Fact Table'[Metric], "product", 'Fact Table'[Metric] * CALCULATE(SUM('Table'[Ratio])) ), [product] ) )If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.