Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Im looking to create sales totals by vendor and month, as well as prior year, current YTD and prior YTD. For Prior Year, im using:
Prior Year = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date Table'[Date]))
However, when i run this i only get the total prior year, and it isnt broken down by specific vendor. Is there a portion of DAX im missing to make this happen?
Thanks!
Solved! Go to Solution.
@Greg_Deckler Thanks! I was able to fix this by examining the relationships a bit more. It seems my filtering criteria was using the dates from the Sales table, not the joined calendar table. Once I changed that to run off the calendar table, all worked as expected! Appreciate the help
@Anonymous - My guess is that you have something in your [Total Sales] measure calculation that is causing this. Probably an ALL statement or something like that. Can you post the code for [Total Sales]?
Hi @Greg_Deckler, thanks for the reply. Im using a very simple formula for total sales:
Total Sales = SUM('Detail Reports'[Amount])
Ive tried using just the SUM() within the Prior year calculation as well, and that doesnt work either.
@Anonymous - Hmm, maybe a missing relationship? It's difficult to say wihtout understanding your data model and how you are using these things in visuals. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Greg_Deckler Thanks! I was able to fix this by examining the relationships a bit more. It seems my filtering criteria was using the dates from the Sales table, not the joined calendar table. Once I changed that to run off the calendar table, all worked as expected! Appreciate the help
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |