Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello!
So i have a yearly Target Amount stored in a table. 15 780.-
Now i have a visual where my target value is 15 780.-. In my visual im able to filter the months if i for example want to look at first quarter i check 1,2,3,4 from month.
The problem is that my Target stays at 15 780.- but i want it to also change when i choose less months.
Therefor i want to make a Measure where i say the Target is 15 780.- from start with all 12 months but if only 6 is selected the Target has to be 7890.-.
Is there some way to get the selected month/months into a measure?
This i what it looks like when i choose 1st quarter:
Solved! Go to Solution.
I apologize for the misplaced " in the formula.
Before you create the date column, click on Month, change the data type to text. Same thing goes to year. Then, you create the date column, after that, change the data type of the date column to date.
Yeah i dont have different budget (target) for different months. It's the yearly budget / 12
If that's the case, I would use Power Query to insert months into your data.
Go to Power Query > Add Custom Column > Enter the formula: {1..12}
When the column is created, click the double arrow and choose Expand to New Rows
After that, you can either add a new column using Power Query or in DAX for your columns, e.g. Monthly Apple = [Apple]/12
This will give you the amount for each month.
You now have your month numbers that you can use to filter. If you wish to convert your month number into month name, please refer to the link below.
https://stackoverflow.com/questions/42964605/how-to-get-month-name-from-month-number-in-power-bi
If you wish to convert month number into Quarter number, use the following formula:
Quarter = "Q" & ROUNDUP('Table'[Month]/3,0)
Thanks for answers.
So i did what you said. Here is my how my Table look like atm.
I also connected the month and year to my date table
Why does my Sum of AHT Grün not show only the Sum of 1st quarter? It's showes the whole year.
That's because the relationship isn't done right. If you could see the dotted lines in your relationship view, that means the relationship is not active. You cannot have 2 different relationships for the same 2 tables.
What I will do next is concatenante your month number to your year with a specific date in your data table. I would do this in Power Query by adding a new column.
Rest of the World -
Date: "1/" & [Month] & "/" & "[Year]
OR
North America Version -
Date: [Month] & "/1/" & [Year]
Use the formula depending on your date formats. Apply the query, and use the newly created column in for your relationship between data table and date table.
Tried this one
Rest of the World -
Date: "1/" & [Month] & "/" & "[Year]
It shows an error right away so i took the " before the Year away so i could save. Like this
Rest of the World -
Date: "1/" & [Month] & "/" & [Year]
Now i get an error saying. Expression.Error: We cannot apply operator & to types text and number...
I apologize for the misplaced " in the formula.
Before you create the date column, click on Month, change the data type to text. Same thing goes to year. Then, you create the date column, after that, change the data type of the date column to date.
No it's just a table with single budget amounts without any other information ( No dates )
Like this:
Apples | Pineapples | Pear
300 | 700 | 450
If your data does not have date values or anything that is related to dates, Power BI will not know what dates those are in.
@darentengmfs I understand but isnt possible at all to see what i choose in the Visual Filter and use these inputs in a measure?
Measure =
Variable = Target/12
CALCULATE( SUM(SELECTEDMONTHS)*Variable)
Something like this
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
83 | |
82 | |
67 | |
49 |
User | Count |
---|---|
135 | |
111 | |
100 | |
65 | |
62 |