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,
I have the following the following report page with a date slicer and a table.
- The date slicer comes from a date table that DOES NOT have a relationship with my facts table.
-The "Max" date in the date slicer is used for the "Calculation" measure (DAX below), which essentially is a SWITCH Function that handles the following conditions.
1) If "End Date" <= "Max" date in the date slicer then return the full value of "Dollars"
2) If "Start Date" = "Max" date in the date slicer then return daily rate of "Dollars" (Dollars / (End Date - Start Date)
3) If "End Date" > "Max" date in the date slicer then return the daily rate * ("Max" date in the date slicer - Start Date)
Calculation Dax
I suspect this is due to the lack of row context when referring to the "Max" start and "end" dates for the total calculations, so the max values of the entire dataset are used rather than calculating row by row.
Here is a link to the pbix file: https://drive.google.com/drive/folders/1GjFTpaLMW-6vf36LFPpHR_IHuhtaAcPL?usp=sharing
Please let me know if any additional information is needed. Any input is appreciated. Thanks!
Solved! Go to Solution.
Hi @bbzzbb808 ,
Thanks for the reply from @DataNinja777 , please allow me to provide another insight:
You can using the following measure.
Measure =
SUMX(
VALUES('Fact Table'[ID]),[Calculation])
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you both! Appreciate the help
Hi @bbzzbb808 ,
Thanks for the reply from @DataNinja777 , please allow me to provide another insight:
You can using the following measure.
Measure =
SUMX(
VALUES('Fact Table'[ID]),[Calculation])
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @bbzzbb808
You can get the correct total of the rows in the visual by using Sumx function. Sumxing Calculation dax over the ID field will get you the correct total you are after.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
14 | |
11 | |
8 |
User | Count |
---|---|
24 | |
19 | |
12 | |
11 | |
10 |