Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I have a star schema model, with some simple dimensions; DimDate, DimSite, and DimProduct.
I need to subtract and then add some values that are not found under the filter context when selecting SiteType. So for example I need to return the SUM of FactSales with a filter in the report slicers with DimDate (e.g) DimDate[IsPreviousMonth] = 1 and DimSite (e.g) DimSite[SiteType] = "Depot", but then take this and add a SUM from a separate hard-coded measure which is under a different SiteType, for example DimSite[SiteType] = "Office".
I've gotten so far with ALL, however when I filter the report via DimSite[SiteType] it will not return a number and gets filtered out.
I am terrible at trying to explain scenarios like this so any questions to make things clearer please let me know.
Thanks,
Gordon
Solved! Go to Solution.
Hi @Anonymous,
You can try to use below measure formula if it suitable for your replacement:
Measure = VAR Selected = CALCULATE ( SUM ( Fact[Sales] ), FILTER ( ALLSELECTED ( DimDate ), DimDate[IsPreviousMonth] = 1 ), DimSite[SiteType] = "Depot" ) VAR Other = CALCULATE ( SUM ( Fact[Sales] ), FILTER ( ALLSELECTED ( DimDate ), DimDate[IsPreviousMonth] = 1 ), FILTER ( ALL ( DimSite ), DimSite[SiteType] = "Office" ) ) RETURN selected + Other
If above not help, please share some sample data for testing and coding formula.
Regards,
Xiaoxin Sheng
Hi @Anonymous,
You can try to use below measure formula if it suitable for your replacement:
Measure = VAR Selected = CALCULATE ( SUM ( Fact[Sales] ), FILTER ( ALLSELECTED ( DimDate ), DimDate[IsPreviousMonth] = 1 ), DimSite[SiteType] = "Depot" ) VAR Other = CALCULATE ( SUM ( Fact[Sales] ), FILTER ( ALLSELECTED ( DimDate ), DimDate[IsPreviousMonth] = 1 ), FILTER ( ALL ( DimSite ), DimSite[SiteType] = "Office" ) ) RETURN selected + Other
If above not help, please share some sample data for testing and coding formula.
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
101 | |
72 | |
47 | |
39 | |
33 |
User | Count |
---|---|
158 | |
102 | |
60 | |
43 | |
40 |