Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am trying to create a visual similar to the one below:
The first measure is something like this:
Quantity = calculate(sum(quantity),filter(colortable, colortable[date]=max(masterdate[date])))
Then I add the color names from a column in the dataset.
This calculation is correct.
Now I want to add the total for that date regardless the color in a new column for the same visual using another measure, does anyone know how to keep the date filter in that measure, but skip the color name?
Note: I dont want to move any of the three measures to calculated columns, just keep them as measures.
Solved! Go to Solution.
Quantity = CALCULATE ( SUM ( colortable[quantity] ), FILTER ( ALL( colortable[date] ), colortable[date] = MAX ( masterdate[date] ) ), ALL ( colortable[color] ) )
If this doesn't work do share the pbix or at least a sample of your tables (in text-tabular format, not screen capture)
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
HI @manuellchavez ,
Maybe you can try to use allexcept function, it only allows specific field filter which you defined in function:
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT
Regards,
XIaoxin Sheng
You'd just need an ALL on the colour column:
Quantity = CALCULATE ( SUM ( colortable[quantity] ), FILTER ( colortable, colortable[date] = MAX ( masterdate[date] ) ), ALL ( colortable[color] ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Thanks for the response @AlB , unfortunatelly it is still not showing the total sum on each row, just the total for each color.
Quantity = CALCULATE ( SUM ( colortable[quantity] ), FILTER ( ALL( colortable[date] ), colortable[date] = MAX ( masterdate[date] ) ), ALL ( colortable[color] ) )
If this doesn't work do share the pbix or at least a sample of your tables (in text-tabular format, not screen capture)
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |